~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/archive/ha_archive.cc

  • Committer: Monty Taylor
  • Date: 2010-02-05 08:11:15 UTC
  • mfrom: (1283 build)
  • mto: (1273.13.43 fix_is)
  • mto: This revision was merged to the branch mainline in revision 1300.
  • Revision ID: mordred@inaugust.com-20100205081115-dr82nvrwv4lvw7sd
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
#include <map>
34
34
 
35
35
using namespace std;
 
36
using namespace drizzled;
36
37
 
37
38
/*
38
39
  First, if you want to understand storage engines you should look at
364
365
  buffer.set((char *)byte_buffer, IO_SIZE, system_charset_info);
365
366
 
366
367
  /* The size of the offset value we will use for position() */
367
 
  ref_length= sizeof(my_off_t);
 
368
  ref_length= sizeof(internal::my_off_t);
368
369
  archive_reader_open= false;
369
370
}
370
371
 
395
396
{
396
397
  memset(&archive_write, 0, sizeof(azio_stream));     /* Archive file we are working with */
397
398
  table_name.append(name);
398
 
  fn_format(data_file_name, table_name.c_str(), "",
 
399
  internal::fn_format(data_file_name, table_name.c_str(), "",
399
400
            ARZ, MY_REPLACE_EXT | MY_UNPACK_FILENAME);
400
401
  /*
401
402
    We will use this lock for rows.
691
692
  /*
692
693
    We reuse name_buff since it is available.
693
694
  */
694
 
  fn_format(name_buff, table_name, "", ARZ,
 
695
  internal::fn_format(name_buff, table_name, "", ARZ,
695
696
            MY_REPLACE_EXT | MY_UNPACK_FILENAME);
696
697
 
697
698
  errno= 0;
1084
1085
 
1085
1086
void ha_archive::position(const unsigned char *)
1086
1087
{
1087
 
  my_store_ptr(ref, ref_length, current_position);
 
1088
  internal::my_store_ptr(ref, ref_length, current_position);
1088
1089
  return;
1089
1090
}
1090
1091
 
1099
1100
int ha_archive::rnd_pos(unsigned char * buf, unsigned char *pos)
1100
1101
{
1101
1102
  ha_statistic_increment(&SSV::ha_read_rnd_next_count);
1102
 
  current_position= (my_off_t)my_get_ptr(pos, ref_length);
 
1103
  current_position= (internal::my_off_t)internal::my_get_ptr(pos, ref_length);
1103
1104
  if (azseek(&archive, (size_t)current_position, SEEK_SET) == (size_t)(-1L))
1104
1105
    return(HA_ERR_CRASHED_ON_USAGE);
1105
1106
  return(get_row(&archive, buf));
1149
1150
  azread_frm(&archive, proto_string);
1150
1151
 
1151
1152
  /* Lets create a file to contain the new data */
1152
 
  fn_format(writer_filename, share->table_name.c_str(), "", ARN,
 
1153
  internal::fn_format(writer_filename, share->table_name.c_str(), "", ARN,
1153
1154
            MY_REPLACE_EXT | MY_UNPACK_FILENAME);
1154
1155
 
1155
1156
  if (!(azopen(&writer, writer_filename, O_CREAT|O_RDWR, AZ_METHOD_BLOCK)))
1232
1233
  azclose(&archive);
1233
1234
 
1234
1235
  // make the file we just wrote be our data file
1235
 
  rc = my_rename(writer_filename,share->data_file_name,MYF(0));
 
1236
  rc = internal::my_rename(writer_filename,share->data_file_name,MYF(0));
1236
1237
 
1237
1238
  free(proto_string);
1238
1239
  return(rc);