138
141
Used for hash table that tracks open tables.
140
static unsigned char* archive_get_key(ARCHIVE_SHARE *share, size_t *length,
141
bool not_used __attribute__((unused)))
143
static uchar* archive_get_key(ARCHIVE_SHARE *share, size_t *length,
144
my_bool not_used __attribute__((unused)))
143
146
*length=share->table_name_length;
144
return (unsigned char*) share->table_name;
147
return (uchar*) share->table_name;
160
163
int archive_db_init(void *p)
165
DBUG_ENTER("archive_db_init");
162
166
handlerton *archive_hton;
164
168
archive_hton= (handlerton *)p;
165
169
archive_hton->state= SHOW_OPTION_YES;
170
archive_hton->db_type= DB_TYPE_ARCHIVE_DB;
166
171
archive_hton->create= archive_create_handler;
167
172
archive_hton->flags= HTON_NO_FLAGS;
168
173
archive_hton->discover= archive_discover;
175
180
if (hash_init(&archive_open_tables, system_charset_info, 32, 0, 0,
176
181
(hash_get_key) archive_get_key, 0, 0))
178
pthread_mutex_destroy(&archive_mutex);
183
VOID(pthread_mutex_destroy(&archive_mutex));
216
221
archive_reader_open= false;
219
int archive_discover(handlerton *hton __attribute__((unused)),
220
THD* thd __attribute__((unused)),
224
int archive_discover(handlerton *hton __attribute__((__unused__)),
225
THD* thd __attribute__((__unused__)),
222
227
const char *name,
223
unsigned char **frmblob,
231
DBUG_ENTER("archive_discover");
232
DBUG_PRINT("archive_discover", ("db: %s, name: %s", db, name));
226
233
azio_stream frm_stream;
227
234
char az_file[FN_REFLEN];
236
243
if (!(azopen(&frm_stream, az_file, O_RDONLY|O_BINARY, AZ_METHOD_BLOCK)))
238
245
if (errno == EROFS || errno == EACCES)
239
return(my_errno= errno);
240
return(HA_ERR_CRASHED_ON_USAGE);
246
DBUG_RETURN(my_errno= errno);
247
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
243
250
if (frm_stream.frm_length == 0)
281
290
ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, int *rc)
293
DBUG_ENTER("ha_archive::get_share");
285
295
pthread_mutex_lock(&archive_mutex);
286
296
length=(uint) strlen(table_name);
288
298
if (!(share=(ARCHIVE_SHARE*) hash_search(&archive_open_tables,
289
(unsigned char*) table_name,
309
319
share->archive_write_open= false;
310
320
fn_format(share->data_file_name, table_name, "",
311
321
ARZ, MY_REPLACE_EXT | MY_UNPACK_FILENAME);
312
my_stpcpy(share->table_name, table_name);
322
strmov(share->table_name, table_name);
323
DBUG_PRINT("ha_archive", ("Data File %s",
324
share->data_file_name));
314
326
We will use this lock for rows.
316
pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST);
328
VOID(pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST));
319
331
We read the meta file, but do not mark it dirty. Since we are not
324
336
if (!(azopen(&archive_tmp, share->data_file_name, O_RDONLY|O_BINARY,
325
337
AZ_METHOD_BLOCK)))
327
pthread_mutex_destroy(&share->mutex);
339
VOID(pthread_mutex_destroy(&share->mutex));
329
341
pthread_mutex_unlock(&archive_mutex);
330
342
*rc= HA_ERR_CRASHED_ON_REPAIR;
333
345
stats.auto_increment_value= archive_tmp.auto_increment + 1;
334
346
share->rows_recorded= (ha_rows)archive_tmp.rows;
341
353
azclose(&archive_tmp);
343
my_hash_insert(&archive_open_tables, (unsigned char*) share);
355
VOID(my_hash_insert(&archive_open_tables, (uchar*) share));
344
356
thr_lock_init(&share->lock);
346
358
share->use_count++;
359
DBUG_PRINT("ha_archive", ("archive table %.*s has %d open handles now",
360
share->table_name_length, share->table_name,
347
362
if (share->crashed)
348
363
*rc= HA_ERR_CRASHED_ON_USAGE;
349
364
pthread_mutex_unlock(&archive_mutex);
359
374
int ha_archive::free_share()
377
DBUG_ENTER("ha_archive::free_share");
378
DBUG_PRINT("ha_archive",
379
("archive table %.*s has %d open handles on entrance",
380
share->table_name_length, share->table_name,
363
383
pthread_mutex_lock(&archive_mutex);
364
384
if (!--share->use_count)
366
hash_delete(&archive_open_tables, (unsigned char*) share);
386
hash_delete(&archive_open_tables, (uchar*) share);
367
387
thr_lock_delete(&share->lock);
368
pthread_mutex_destroy(&share->mutex);
388
VOID(pthread_mutex_destroy(&share->mutex));
370
390
We need to make sure we don't reset the crashed state.
371
391
If we open a crashed file, wee need to close it as crashed unless
378
398
if (azclose(&(share->archive_write)))
381
free((unsigned char*) share);
401
my_free((uchar*) share, MYF(0));
383
403
pthread_mutex_unlock(&archive_mutex);
388
408
int ha_archive::init_archive_writer()
410
DBUG_ENTER("ha_archive::init_archive_writer");
391
412
It is expensive to open and close the data files and since you can't have
392
413
a gzip file that can be both read and written we keep a writer open
463
487
We open the file we will read from.
465
489
int ha_archive::open(const char *name,
466
int mode __attribute__((unused)),
467
uint32_t open_options)
490
int mode __attribute__((__unused__)),
494
DBUG_ENTER("ha_archive::open");
496
DBUG_PRINT("ha_archive", ("archive table was opened for crash: %s",
497
(open_options & HA_OPEN_FOR_REPAIR) ? "yes" : "no"));
470
498
share= get_share(name, &rc);
472
500
if (rc == HA_ERR_CRASHED_ON_USAGE && !(open_options & HA_OPEN_FOR_REPAIR))
474
502
/* purecov: begin inspected */
477
505
/* purecov: end */
479
507
else if (rc == HA_ERR_OUT_OF_MEM)
486
514
record_buffer= create_record_buffer(table->s->reclength +
487
515
ARCHIVE_ROW_HEADER_SIZE);
489
517
if (!record_buffer)
492
return(HA_ERR_OUT_OF_MEM);
520
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
495
523
thr_lock_data_init(&share->lock, &lock, NULL);
525
DBUG_PRINT("ha_archive", ("archive table was crashed %s",
526
rc == HA_ERR_CRASHED_ON_USAGE ? "yes" : "no"));
497
527
if (rc == HA_ERR_CRASHED_ON_USAGE && open_options & HA_OPEN_FOR_REPAIR)
557
588
azio_stream create_stream; /* Archive file we are working with */
558
589
File frm_file; /* File handler for readers */
559
590
struct stat file_stat;
560
unsigned char *frm_ptr;
593
DBUG_ENTER("ha_archive::create");
562
595
stats.auto_increment_value= create_info->auto_increment_value;
564
for (uint32_t key= 0; key < table_arg->sizeKeys(); key++)
597
for (uint key= 0; key < table_arg->s->keys; key++)
566
599
KEY *pos= table_arg->key_info+key;
567
600
KEY_PART_INFO *key_part= pos->key_part;
585
619
if (create_info->data_file_name && create_info->data_file_name[0] != '#')
621
DBUG_PRINT("ha_archive", ("archive will create stream file %s",
622
create_info->data_file_name));
587
624
fn_format(name_buff, create_info->data_file_name, "", ARZ,
588
625
MY_REPLACE_EXT | MY_UNPACK_FILENAME);
589
626
fn_format(linkname, name, "", ARZ,
623
660
if (fstat(frm_file, &file_stat))
625
frm_ptr= (unsigned char *)my_malloc(sizeof(unsigned char) * file_stat.st_size, MYF(0));
662
frm_ptr= (uchar *)my_malloc(sizeof(uchar) * file_stat.st_size, MYF(0));
628
665
my_read(frm_file, frm_ptr, file_stat.st_size, MYF(0));
629
666
azwrite_frm(&create_stream, (char *)frm_ptr, file_stat.st_size);
630
free((unsigned char*)frm_ptr);
667
my_free((uchar*)frm_ptr, MYF(0));
633
670
my_close(frm_file, MYF(0));
692
DBUG_PRINT("ha_archive", ("Creating File %s", name_buff));
693
DBUG_PRINT("ha_archive", ("Creating Link %s", linkname));
658
699
delete_table(name);
660
701
/* Return error number, if we got one */
661
return(error ? error : -1);
702
DBUG_RETURN(error ? error : -1);
665
706
This is where the actual row is written out.
667
int ha_archive::real_write_row(unsigned char *buf, azio_stream *writer)
708
int ha_archive::real_write_row(uchar *buf, azio_stream *writer)
669
710
my_off_t written;
670
711
unsigned int r_pack_length;
712
DBUG_ENTER("ha_archive::real_write_row");
672
714
/* We pack the row for writing */
673
715
r_pack_length= pack_row(buf);
690
735
the bytes required for the length in the header.
693
uint32_t ha_archive::max_row_length(const unsigned char *buf __attribute__((unused)))
738
uint32 ha_archive::max_row_length(const uchar *buf __attribute__((__unused__)))
695
uint32_t length= (uint32_t)(table->getRecordLength() + table->sizeFields()*2);
740
uint32 length= (uint32)(table->s->reclength + table->s->fields*2);
696
741
length+= ARCHIVE_ROW_HEADER_SIZE;
699
for (ptr= table->getBlobField(), end=ptr + table->sizeBlobFields();
744
for (ptr= table->s->blob_field, end=ptr + table->s->blob_fields ;
710
unsigned int ha_archive::pack_row(unsigned char *record)
755
unsigned int ha_archive::pack_row(uchar *record)
759
DBUG_ENTER("ha_archive::pack_row");
714
762
if (fix_rec_buff(max_row_length(record)))
715
return(HA_ERR_OUT_OF_MEM); /* purecov: inspected */
763
DBUG_RETURN(HA_ERR_OUT_OF_MEM); /* purecov: inspected */
717
765
/* Copy null bits */
718
766
memcpy(record_buffer->buffer, record, table->s->null_bytes);
724
772
ptr= (*field)->pack(ptr, record + (*field)->offset(record));
727
return((unsigned int) (ptr - record_buffer->buffer));
775
DBUG_PRINT("ha_archive",("Pack row length %u", (unsigned int)
776
(ptr - record_buffer->buffer -
777
ARCHIVE_ROW_HEADER_SIZE)));
779
DBUG_RETURN((unsigned int) (ptr - record_buffer->buffer));
737
789
for implementing start_bulk_insert() is that we could skip
738
790
setting dirty to true each time.
740
int ha_archive::write_row(unsigned char *buf)
792
int ha_archive::write_row(uchar *buf)
743
unsigned char *read_buf= NULL;
795
uchar *read_buf= NULL;
744
796
uint64_t temp_auto;
745
unsigned char *record= table->record[0];
797
uchar *record= table->record[0];
798
DBUG_ENTER("ha_archive::write_row");
747
800
if (share->crashed)
748
return(HA_ERR_CRASHED_ON_USAGE);
801
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
750
803
ha_statistic_increment(&SSV::ha_write_count);
751
804
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
836
889
pthread_mutex_unlock(&share->mutex);
838
free((unsigned char*) read_buf);
891
my_free((uchar*) read_buf, MYF(0));
844
void ha_archive::get_auto_increment(uint64_t offset __attribute__((unused)),
845
uint64_t increment __attribute__((unused)),
846
uint64_t nb_desired_values __attribute__((unused)),
847
uint64_t *first_value __attribute__((unused)),
848
uint64_t *nb_reserved_values __attribute__((unused)))
897
void ha_archive::get_auto_increment(uint64_t offset __attribute__((__unused__)),
898
uint64_t increment __attribute__((__unused__)),
899
uint64_t nb_desired_values __attribute__((__unused__)),
900
uint64_t *first_value __attribute__((__unused__)),
901
uint64_t *nb_reserved_values __attribute__((__unused__)))
850
903
*nb_reserved_values= UINT64_MAX;
851
904
*first_value= share->archive_write.auto_increment + 1;
854
907
/* Initialized at each key walk (called multiple times unlike rnd_init()) */
855
int ha_archive::index_init(uint32_t keynr, bool sorted __attribute__((unused)))
908
int ha_archive::index_init(uint keynr, bool sorted __attribute__((__unused__)))
910
DBUG_ENTER("ha_archive::index_init");
857
911
active_index= keynr;
863
917
No indexes, so if we get a request for an index search since we tell
864
918
the optimizer that we have unique indexes, we scan
866
int ha_archive::index_read(unsigned char *buf, const unsigned char *key,
867
uint32_t key_len, enum ha_rkey_function find_flag)
920
int ha_archive::index_read(uchar *buf, const uchar *key,
921
uint key_len, enum ha_rkey_function find_flag)
924
DBUG_ENTER("ha_archive::index_read");
870
925
rc= index_read_idx(buf, active_index, key, key_len, find_flag);
875
int ha_archive::index_read_idx(unsigned char *buf, uint32_t index, const unsigned char *key,
877
enum ha_rkey_function find_flag __attribute__((unused)))
930
int ha_archive::index_read_idx(uchar *buf, uint index, const uchar *key,
932
enum ha_rkey_function find_flag __attribute__((__unused__)))
904
return(rc ? rc : HA_ERR_END_OF_FILE);
962
DBUG_RETURN(rc ? rc : HA_ERR_END_OF_FILE);
908
int ha_archive::index_next(unsigned char * buf)
966
int ha_archive::index_next(uchar * buf)
970
DBUG_ENTER("ha_archive::index_next");
912
972
while (!(get_row(&archive, buf)))
914
974
if (!memcmp(current_key, buf+current_k_offset, current_key_len))
930
990
int ha_archive::rnd_init(bool scan)
992
DBUG_ENTER("ha_archive::rnd_init");
932
994
if (share->crashed)
933
return(HA_ERR_CRASHED_ON_USAGE);
995
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
935
997
init_archive_reader();
937
999
/* We rewind the file so that we can read from the beginning if scan */
1002
DBUG_PRINT("info", ("archive will retrieve %llu rows",
1003
(uint64_t) scan_rows));
940
1005
if (read_data_header(&archive))
941
return(HA_ERR_CRASHED_ON_USAGE);
1006
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
949
1014
This is the method that is used to read a row. It assumes that the row is
950
1015
positioned where you want it.
952
int ha_archive::get_row(azio_stream *file_to_read, unsigned char *buf)
1017
int ha_archive::get_row(azio_stream *file_to_read, uchar *buf)
1020
DBUG_ENTER("ha_archive::get_row");
1021
DBUG_PRINT("ha_archive", ("Picking version for get_row() %d -> %d",
1022
(uchar)file_to_read->version,
956
1024
if (file_to_read->version == ARCHIVE_VERSION)
957
1025
rc= get_row_version3(file_to_read, buf);
1029
DBUG_PRINT("ha_archive", ("Return %d\n", rc));
964
1034
/* Reallocate buffer if needed */
965
1035
bool ha_archive::fix_rec_buff(unsigned int length)
967
assert(record_buffer->buffer);
1037
DBUG_ENTER("ha_archive::fix_rec_buff");
1038
DBUG_PRINT("ha_archive", ("Fixing %u for %u",
1039
length, record_buffer->length));
1040
DBUG_ASSERT(record_buffer->buffer);
969
1042
if (length > record_buffer->length)
971
unsigned char *newptr;
972
if (!(newptr=(unsigned char*) my_realloc((unsigned char*) record_buffer->buffer,
1045
if (!(newptr=(uchar*) my_realloc((uchar*) record_buffer->buffer,
974
1047
MYF(MY_ALLOW_ZERO_PTR))))
976
1049
record_buffer->buffer= newptr;
977
1050
record_buffer->length= length;
980
assert(length <= record_buffer->length);
1053
DBUG_ASSERT(length <= record_buffer->length);
985
int ha_archive::unpack_row(azio_stream *file_to_read, unsigned char *record)
1058
int ha_archive::unpack_row(azio_stream *file_to_read, uchar *record)
1060
DBUG_ENTER("ha_archive::unpack_row");
987
1062
unsigned int read;
989
const unsigned char *ptr;
991
1066
read= azread_row(file_to_read, &error);
992
ptr= (const unsigned char *)file_to_read->row_ptr;
1067
ptr= (const uchar *)file_to_read->row_ptr;
994
1069
if (error || read == 0)
999
1074
/* Copy null bits */
1000
memcpy(record, ptr, table->getNullBytes());
1001
ptr+= table->getNullBytes();
1075
memcpy(record, ptr, table->s->null_bytes);
1076
ptr+= table->s->null_bytes;
1002
1077
for (Field **field=table->field ; *field ; field++)
1004
1079
if (!((*field)->is_null()))
1006
1081
ptr= (*field)->unpack(record + (*field)->offset(table->record[0]), ptr);
1013
int ha_archive::get_row_version3(azio_stream *file_to_read, unsigned char *buf)
1088
int ha_archive::get_row_version3(azio_stream *file_to_read, uchar *buf)
1090
DBUG_ENTER("ha_archive::get_row_version3");
1015
1092
int returnable= unpack_row(file_to_read, buf);
1094
DBUG_RETURN(returnable);
1023
1100
or by having had ha_archive::rnd_pos() called before it is called.
1026
int ha_archive::rnd_next(unsigned char *buf)
1103
int ha_archive::rnd_next(uchar *buf)
1106
DBUG_ENTER("ha_archive::rnd_next");
1030
1108
if (share->crashed)
1031
return(HA_ERR_CRASHED_ON_USAGE);
1109
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
1033
1111
if (!scan_rows)
1034
return(HA_ERR_END_OF_FILE);
1112
DBUG_RETURN(HA_ERR_END_OF_FILE);
1037
1115
ha_statistic_increment(&SSV::ha_read_rnd_next_count);
1064
1143
correctly ordered row.
1067
int ha_archive::rnd_pos(unsigned char * buf, unsigned char *pos)
1146
int ha_archive::rnd_pos(uchar * buf, uchar *pos)
1148
DBUG_ENTER("ha_archive::rnd_pos");
1069
1149
ha_statistic_increment(&SSV::ha_read_rnd_next_count);
1070
1150
current_position= (my_off_t)my_get_ptr(pos, ref_length);
1071
1151
if (azseek(&archive, (size_t)current_position, SEEK_SET) == (size_t)(-1L))
1072
return(HA_ERR_CRASHED_ON_USAGE);
1073
return(get_row(&archive, buf));
1152
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
1153
DBUG_RETURN(get_row(&archive, buf));
1081
1161
int ha_archive::repair(THD* thd, HA_CHECK_OPT* check_opt)
1163
DBUG_ENTER("ha_archive::repair");
1083
1164
check_opt->flags= T_EXTEND;
1084
1165
int rc= optimize(thd, check_opt);
1087
return(HA_ERR_CRASHED_ON_REPAIR);
1168
DBUG_RETURN(HA_ERR_CRASHED_ON_REPAIR);
1089
1170
share->crashed= false;
1094
1175
The table can become fragmented if data was inserted, read, and then
1095
1176
inserted again. What we do is open up the file and recompress it completely.
1097
int ha_archive::optimize(THD* thd __attribute__((unused)),
1098
HA_CHECK_OPT* check_opt __attribute__((unused)))
1178
int ha_archive::optimize(THD* thd __attribute__((__unused__)),
1179
HA_CHECK_OPT* check_opt __attribute__((__unused__)))
1181
DBUG_ENTER("ha_archive::optimize");
1101
1183
azio_stream writer;
1102
1184
char writer_filename[FN_REFLEN];
1115
1197
MY_REPLACE_EXT | MY_UNPACK_FILENAME);
1117
1199
if (!(azopen(&writer, writer_filename, O_CREAT|O_RDWR|O_BINARY, AZ_METHOD_BLOCK)))
1118
return(HA_ERR_CRASHED_ON_USAGE);
1200
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
1121
1203
An extended rebuild is a lot more effort. We open up each row and re-record it.
1170
1255
(share->archive_write.auto_increment= auto_value) + 1;
1258
dbug_tmp_restore_column_map(table->read_set, org_bitmap);
1173
1259
share->rows_recorded= (ha_rows)writer.rows;
1262
DBUG_PRINT("info", ("recovered %llu archive rows",
1263
(uint64_t)share->rows_recorded));
1265
DBUG_PRINT("ha_archive", ("recovered %llu archive rows",
1266
(uint64_t)share->rows_recorded));
1176
1268
if (rc && rc != HA_ERR_END_OF_FILE)
1251
1346
if (!(my_readlink(share->real_path, share->data_file_name, MYF(0))))
1252
1347
create_info->data_file_name= share->real_path;
1259
1354
Hints for optimizer, see ha_tina for more information
1261
int ha_archive::info(uint32_t flag)
1356
int ha_archive::info(uint flag)
1358
DBUG_ENTER("ha_archive::info");
1264
1361
If dirty, we lock, and then reset/flush the data.
1265
1362
I found that just calling azflush() doesn't always work.
1288
1386
scan_rows= stats.records;
1289
1387
stats.deleted= 0;
1389
DBUG_PRINT("ha_archive", ("Stats rows is %d\n", (int)stats.records));
1291
1390
/* Costs quite a bit more to get all information */
1292
1391
if (flag & HA_STATUS_TIME)
1294
1393
struct stat file_stat; // Stat information for the data file
1296
stat(share->data_file_name, &file_stat);
1395
VOID(stat(share->data_file_name, &file_stat));
1298
stats.mean_rec_length= table->getRecordLength()+ buffer.alloced_length();
1397
stats.mean_rec_length= table->s->reclength + buffer.alloced_length();
1299
1398
stats.data_file_length= file_stat.st_size;
1300
1399
stats.create_time= file_stat.st_ctime;
1301
1400
stats.update_time= file_stat.st_mtime;
1367
1470
int ha_archive::check(THD* thd,
1368
HA_CHECK_OPT* check_opt __attribute__((unused)))
1471
HA_CHECK_OPT* check_opt __attribute__((__unused__)))
1371
1474
const char *old_proc_info;
1476
DBUG_ENTER("ha_archive::check");
1374
1478
old_proc_info= thd_proc_info(thd, "Checking table");
1375
1479
/* Flush any waiting data */
1411
1515
bool ha_archive::check_and_repair(THD *thd)
1413
1517
HA_CHECK_OPT check_opt;
1518
DBUG_ENTER("ha_archive::check_and_repair");
1415
1520
check_opt.init();
1417
return(repair(thd, &check_opt));
1522
DBUG_RETURN(repair(thd, &check_opt));
1420
1525
archive_record_buffer *ha_archive::create_record_buffer(unsigned int length)
1527
DBUG_ENTER("ha_archive::create_record_buffer");
1422
1528
archive_record_buffer *r;
1424
1530
(archive_record_buffer*) my_malloc(sizeof(archive_record_buffer),
1427
return(NULL); /* purecov: inspected */
1533
DBUG_RETURN(NULL); /* purecov: inspected */
1429
1535
r->length= (int)length;
1431
if (!(r->buffer= (unsigned char*) my_malloc(r->length,
1537
if (!(r->buffer= (uchar*) my_malloc(r->length,
1435
return(NULL); /* purecov: inspected */
1540
my_free((char*) r, MYF(MY_ALLOW_ZERO_PTR));
1541
DBUG_RETURN(NULL); /* purecov: inspected */
1441
1547
void ha_archive::destroy_record_buffer(archive_record_buffer *r)
1443
free((char*) r->buffer);
1549
DBUG_ENTER("ha_archive::destroy_record_buffer");
1550
my_free((char*) r->buffer, MYF(MY_ALLOW_ZERO_PTR));
1551
my_free((char*) r, MYF(MY_ALLOW_ZERO_PTR));
1448
static DRIZZLE_SYSVAR_BOOL(aio, archive_use_aio,
1555
static MYSQL_SYSVAR_BOOL(aio, archive_use_aio,
1449
1556
PLUGIN_VAR_NOCMDOPT,
1450
1557
"Whether or not to use asynchronous IO.",
1451
1558
NULL, NULL, true);
1453
1560
static struct st_mysql_sys_var* archive_system_variables[]= {
1454
DRIZZLE_SYSVAR(aio),
1565
struct st_mysql_storage_engine archive_storage_engine=
1566
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
1458
1568
mysql_declare_plugin(archive)
1460
DRIZZLE_STORAGE_ENGINE_PLUGIN,
1570
MYSQL_STORAGE_ENGINE_PLUGIN,
1571
&archive_storage_engine,
1463
1573
"Brian Aker, MySQL AB",
1464
1574
"Archive storage engine",
1465
1575
PLUGIN_LICENSE_GPL,
1466
1576
archive_db_init, /* Plugin Init */
1467
1577
archive_db_done, /* Plugin Deinit */
1468
1579
NULL, /* status variables */
1469
1580
archive_system_variables, /* system variables */
1470
1581
NULL /* config options */