14
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
17
#ifdef USE_PRAGMA_IMPLEMENTATION
18
#pragma implementation // gcc: Class implementation
21
#define DRIZZLE_SERVER 1
23
18
#include <drizzled/server_includes.h>
24
19
#include <mysys/my_bit.h>
25
#include <myisampack.h>
20
#include "myisampack.h"
26
21
#include "ha_myisam.h"
27
22
#include "myisamdef.h"
28
#include <drizzled/drizzled_error_messages.h>
23
#include <drizzled/util/test.h>
24
#include <drizzled/error.h>
25
#include <drizzled/errmsg_print.h>
26
#include <drizzled/gettext.h>
27
#include <drizzled/session.h>
28
#include <drizzled/plugin/protocol.h>
29
#include <drizzled/table.h>
30
#include <drizzled/field/timestamp.h>
37
static const string engine_name("MyISAM");
30
39
ulong myisam_recover_options= HA_RECOVER_NONE;
40
pthread_mutex_t THR_LOCK_myisam= PTHREAD_MUTEX_INITIALIZER;
42
static uint32_t repair_threads;
43
static uint32_t block_size;
44
static uint64_t max_sort_file_size;
45
static uint64_t sort_buffer_size;
32
47
/* bits in myisam_recover_options */
33
48
const char *myisam_recover_names[] =
34
49
{ "DEFAULT", "BACKUP", "FORCE", "QUICK", NULL};
35
50
TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names)-1,"",
36
myisam_recover_names, NULL};
51
myisam_recover_names, NULL};
38
const char *myisam_stats_method_names[] = {"nulls_unequal", "nulls_equal",
39
"nulls_ignored", NULL};
40
TYPELIB myisam_stats_method_typelib= {
41
array_elements(myisam_stats_method_names) - 1, "",
42
myisam_stats_method_names, NULL};
45
55
/*****************************************************************************
47
57
*****************************************************************************/
49
static handler *myisam_create_handler(handlerton *hton,
59
static const char *ha_myisam_exts[] = {
65
class MyisamEngine : public StorageEngine
53
return new (mem_root) ha_myisam(hton, table);
68
MyisamEngine(string name_arg)
69
: StorageEngine(name_arg,
76
virtual handler *create(TableShare *table,
79
return new (mem_root) ha_myisam(this, table);
82
const char **bas_ext() const {
83
return ha_myisam_exts;
86
int createTableImplementation(Session *, const char *table_name,
88
HA_CREATE_INFO *ha_create_info,
89
drizzled::message::Table*);
91
int renameTableImplementation(Session*, const char *from, const char *to);
93
int deleteTableImplementation(Session*, const string table_name);
56
96
// collect errors printed by mi_check routines
58
98
static void mi_check_print_msg(MI_CHECK *param, const char* msg_type,
59
const char *fmt, va_list args)
99
const char *fmt, va_list args)
61
THD* thd = (THD*)param->thd;
62
Protocol *protocol= thd->protocol;
101
Session* session = (Session*)param->session;
102
drizzled::plugin::Protocol *protocol= session->protocol;
63
103
uint32_t length, msg_length;
64
104
char msgbuf[MI_MAX_MSG_BUF];
65
105
char name[NAME_LEN*2+2];
442
482
void _mi_report_crashed(MI_INFO *file, const char *message,
443
483
const char *sfile, uint32_t sline)
485
Session *cur_session;
447
486
pthread_mutex_lock(&file->s->intern_lock);
448
if ((cur_thd= (THD*) file->in_use.data))
449
sql_print_error("Got an error from thread_id=%lu, %s:%d", cur_thd->thread_id,
487
if ((cur_session= file->in_use))
488
errmsg_printf(ERRMSG_LVL_ERROR, _("Got an error from thread_id=%"PRIu64", %s:%d"),
489
cur_session->thread_id,
452
sql_print_error("Got an error from unknown thread, %s:%d", sfile, sline);
492
errmsg_printf(ERRMSG_LVL_ERROR, _("Got an error from unknown thread, %s:%d"), sfile, sline);
454
sql_print_error("%s", message);
455
for (element= file->s->in_use; element; element= list_rest(element))
494
errmsg_printf(ERRMSG_LVL_ERROR, "%s", message);
495
list<Session *>::iterator it= file->s->in_use->begin();
496
while (it != file->s->in_use->end())
457
sql_print_error("%s", "Unknown thread accessing table");
498
errmsg_printf(ERRMSG_LVL_ERROR, "%s", _("Unknown thread accessing table"));
459
501
pthread_mutex_unlock(&file->s->intern_lock);
464
ha_myisam::ha_myisam(handlerton *hton, TABLE_SHARE *table_arg)
465
:handler(hton, table_arg), file(0),
506
ha_myisam::ha_myisam(StorageEngine *engine_arg, TableShare *table_arg)
507
:handler(engine_arg, table_arg), file(0),
466
508
int_table_flags(HA_NULL_IN_KEY |
467
HA_BINLOG_ROW_CAPABLE |
468
HA_BINLOG_STMT_CAPABLE |
469
509
HA_DUPLICATE_POS |
470
510
HA_CAN_INDEX_BLOBS |
471
511
HA_AUTO_PART_KEY |
473
512
HA_NO_TRANSACTIONS |
475
514
HA_STATS_RECORDS_IS_EXACT |
795
int ha_myisam::optimize(THD* thd, HA_CHECK_OPT *check_opt)
820
int ha_myisam::optimize(Session* session, HA_CHECK_OPT *check_opt)
798
823
if (!file) return HA_ADMIN_INTERNAL_ERROR;
801
826
myisamchk_init(¶m);
827
param.session = session;
803
828
param.op_name= "optimize";
804
829
param.testflag= (check_opt->flags | T_SILENT | T_FORCE_CREATE |
805
830
T_REP_BY_SORT | T_STATISTICS | T_SORT_INDEX);
806
param.sort_buffer_length= check_opt->sort_buffer_size;
807
if ((error= repair(thd,param,1)) && param.retry_repair)
831
param.sort_buffer_length= (size_t)sort_buffer_size;
832
if ((error= repair(session,param,1)) && param.retry_repair)
809
sql_print_warning("Warning: Optimize table got errno %d on %s.%s, retrying",
834
errmsg_printf(ERRMSG_LVL_WARN, "Warning: Optimize table got errno %d on %s.%s, retrying",
810
835
my_errno, param.db_name, param.table_name);
811
836
param.testflag&= ~T_REP_BY_SORT;
812
error= repair(thd,param,1);
837
error= repair(session,param,1);
818
int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool do_optimize)
843
int ha_myisam::repair(Session *session, MI_CHECK ¶m, bool do_optimize)
821
uint32_t local_testflag=param.testflag;
846
uint32_t local_testflag= param.testflag;
822
847
bool optimize_done= !do_optimize, statistics_done=0;
823
const char *old_proc_info= thd->get_proc_info();
848
const char *old_proc_info= session->get_proc_info();
824
849
char fixed_name[FN_REFLEN];
825
850
MYISAM_SHARE* share = file->s;
826
851
ha_rows rows= file->state->records;
873
897
local_testflag|= T_STATISTICS;
874
898
param.testflag|= T_STATISTICS; // We get this for free
875
899
statistics_done=1;
876
if (thd->variables.myisam_repair_threads>1)
900
if (repair_threads > 1)
879
903
/* TODO: respect myisam_repair_threads variable */
880
904
snprintf(buf, 40, "Repair with %d threads", my_count_bits(key_map));
881
thd_proc_info(thd, buf);
905
session->set_proc_info(buf);
882
906
error = mi_repair_parallel(¶m, file, fixed_name,
883
907
param.testflag & T_QUICK);
884
thd_proc_info(thd, "Repair done"); // to reset proc_info, as
908
session->set_proc_info("Repair done"); // to reset proc_info, as
885
909
// it was pointing to local buffer
889
thd_proc_info(thd, "Repair by sorting");
913
session->set_proc_info("Repair by sorting");
890
914
error = mi_repair_by_sort(¶m, file, fixed_name,
891
915
param.testflag & T_QUICK);
896
thd_proc_info(thd, "Repair with keycache");
920
session->set_proc_info("Repair with keycache");
897
921
param.testflag &= ~T_REP_BY_SORT;
898
922
error= mi_repair(¶m, file, fixed_name,
899
923
param.testflag & T_QUICK);
1108
1127
else if (mode == HA_KEY_SWITCH_NONUNIQ_SAVE)
1110
THD *thd=current_thd;
1129
Session *session=current_session;
1111
1130
MI_CHECK param;
1112
const char *save_proc_info= thd->get_proc_info();
1113
thd_proc_info(thd, "Creating index");
1131
const char *save_proc_info= session->get_proc_info();
1132
session->set_proc_info("Creating index");
1114
1133
myisamchk_init(¶m);
1115
1134
param.op_name= "recreating_index";
1116
1135
param.testflag= (T_SILENT | T_REP_BY_SORT | T_QUICK |
1117
1136
T_CREATE_MISSING_KEYS);
1118
1137
param.myf_rw&= ~MY_WAIT_IF_FULL;
1119
param.sort_buffer_length= thd->variables.myisam_sort_buff_size;
1120
param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method;
1121
param.tmpdir=&mysql_tmpdir_list;
1122
if ((error= (repair(thd,param,0) != HA_ADMIN_OK)) && param.retry_repair)
1138
param.sort_buffer_length= (size_t)sort_buffer_size;
1139
param.stats_method= MI_STATS_METHOD_NULLS_NOT_EQUAL;
1140
if ((error= (repair(session,param,0) != HA_ADMIN_OK)) && param.retry_repair)
1124
sql_print_warning("Warning: Enabling keys got errno %d on %s.%s, retrying",
1142
errmsg_printf(ERRMSG_LVL_WARN, "Warning: Enabling keys got errno %d on %s.%s, retrying",
1125
1143
my_errno, param.db_name, param.table_name);
1126
1144
/* Repairing by sort failed. Now try standard repair method. */
1127
1145
param.testflag&= ~(T_REP_BY_SORT | T_QUICK);
1128
error= (repair(thd,param,0) != HA_ADMIN_OK);
1146
error= (repair(session,param,0) != HA_ADMIN_OK);
1130
1148
If the standard repair succeeded, clear all error messages which
1131
1149
might have been set by the first repair. They can still be seen
1132
1150
with SHOW WARNINGS then.
1153
session->clear_error();
1137
1155
info(HA_STATUS_CONST);
1138
thd_proc_info(thd, save_proc_info);
1156
session->set_proc_info(save_proc_info);
1239
bool ha_myisam::check_and_repair(THD *thd)
1244
uint32_t old_query_length;
1245
HA_CHECK_OPT check_opt;
1248
check_opt.flags= T_MEDIUM | T_AUTO_REPAIR;
1249
// Don't use quick if deleted rows
1250
if (!file->state->del && (myisam_recover_options & HA_RECOVER_QUICK))
1251
check_opt.flags|=T_QUICK;
1252
sql_print_warning("Checking table: '%s'",table->s->path.str);
1254
old_query= thd->query;
1255
old_query_length= thd->query_length;
1256
pthread_mutex_lock(&LOCK_thread_count);
1257
thd->query= table->s->table_name.str;
1258
thd->query_length= table->s->table_name.length;
1259
pthread_mutex_unlock(&LOCK_thread_count);
1261
if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt))
1263
sql_print_warning("Recovering table: '%s'",table->s->path.str);
1265
((myisam_recover_options & HA_RECOVER_BACKUP ? T_BACKUP_DATA : 0) |
1266
(marked_crashed ? 0 : T_QUICK) |
1267
(myisam_recover_options & HA_RECOVER_FORCE ? 0 : T_SAFE_REPAIR) |
1269
if (repair(thd, &check_opt))
1272
pthread_mutex_lock(&LOCK_thread_count);
1273
thd->query= old_query;
1274
thd->query_length= old_query_length;
1275
pthread_mutex_unlock(&LOCK_thread_count);
1279
1257
bool ha_myisam::is_crashed() const
1296
1274
return mi_delete(file,buf);
1303
bool index_cond_func_myisam(void *arg)
1278
int ha_myisam::index_init(uint32_t idx, bool )
1305
ha_myisam *h= (ha_myisam*)arg;
1306
/*if (h->in_range_read)*/
1309
if (h->compare_key2(h->end_range) > 0)
1310
return 2; /* caller should return HA_ERR_END_OF_FILE already */
1312
return (bool)h->pushed_idx_cond->val_int();
1320
int ha_myisam::index_init(uint32_t idx, bool sorted __attribute__((unused)))
1322
1280
active_index=idx;
1323
1281
//in_range_read= false;
1324
if (pushed_idx_cond_keyno == idx)
1325
mi_set_index_cond_func(file, index_cond_func_myisam, this);
1330
1286
int ha_myisam::index_end()
1332
1288
active_index=MAX_KEY;
1333
//pushed_idx_cond_keyno= MAX_KEY;
1334
mi_set_index_cond_func(file, NULL, 0);
1335
in_range_check_pushed_down= false;
1336
ds_mrr.dsmrr_close();
1293
uint32_t ha_myisam::index_flags(uint32_t inx, uint32_t, bool) const
1295
return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ?
1296
0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE |
1297
HA_READ_ORDER | HA_KEYREAD_ONLY |
1298
(keys_with_parts.test(inx)?0:HA_DO_INDEX_COND_PUSHDOWN));
1501
1462
if (flag & HA_STATUS_CONST)
1503
TABLE_SHARE *share= table->s;
1464
TableShare *share= table->s;
1504
1465
stats.max_data_file_length= misam_info.max_data_file_length;
1505
1466
stats.max_index_file_length= misam_info.max_index_file_length;
1506
1467
stats.create_time= misam_info.create_time;
1507
1468
ref_length= misam_info.reflength;
1508
1469
share->db_options_in_use= misam_info.options;
1509
stats.block_size= myisam_block_size; /* record block size */
1470
stats.block_size= block_size; /* record block size */
1511
1472
/* Update share */
1512
1473
if (share->tmp_table == NO_TMP_TABLE)
1513
1474
pthread_mutex_lock(&share->mutex);
1514
share->keys_in_use.set_prefix(share->keys);
1515
share->keys_in_use.intersect_extended(misam_info.key_map);
1516
share->keys_for_keyread.intersect(share->keys_in_use);
1475
set_prefix(share->keys_in_use, share->keys);
1477
* Due to bug 394932 (32-bit solaris build failure), we need
1478
* to convert the uint64_t key_map member of the misam_info
1479
* structure in to a std::bitset so that we can logically and
1480
* it with the share->key_in_use key_map.
1483
string binary_key_map;
1484
uint64_t num= misam_info.key_map;
1486
* Convert the uint64_t to a binary
1487
* string representation of it.
1491
uint64_t bin_digit= num % 2;
1495
binary_key_map.append(ostr.str());
1497
* Now we have the binary string representation of the
1498
* flags, we need to fill that string representation out
1499
* with the appropriate number of bits. This is needed
1500
* since key_map is declared as a std::bitset of a certain bit
1501
* width that depends on the MAX_INDEXES variable.
1503
if (MAX_INDEXES <= 64)
1505
size_t len= 72 - binary_key_map.length();
1506
string all_zeros(len, '0');
1507
binary_key_map.insert(binary_key_map.begin(),
1513
size_t len= (MAX_INDEXES + 7) / 8 * 8;
1514
string all_zeros(len, '0');
1515
binary_key_map.insert(binary_key_map.begin(),
1519
key_map tmp_map(binary_key_map);
1520
share->keys_in_use&= tmp_map;
1521
share->keys_for_keyread&= share->keys_in_use;
1517
1522
share->db_record_offset= misam_info.record_offset;
1518
1523
if (share->key_parts)
1519
1524
memcpy(table->key_info[0].rec_per_key,
1576
1577
return mi_delete_all_rows(file);
1579
int ha_myisam::delete_table(const char *name)
1580
int MyisamEngine::deleteTableImplementation(Session*, const string table_name)
1581
return mi_delete_table(name);
1582
return mi_delete_table(table_name.c_str());
1585
int ha_myisam::external_lock(THD *thd, int lock_type)
1586
int ha_myisam::external_lock(Session *session, int lock_type)
1587
file->in_use.data= thd;
1588
file->in_use= session;
1588
1589
return mi_lock_database(file, !table->s->tmp_table ?
1589
1590
lock_type : ((lock_type == F_UNLCK) ?
1590
1591
F_UNLCK : F_EXTRA_LCK));
1593
THR_LOCK_DATA **ha_myisam::store_lock(THD *thd __attribute__((unused)),
1594
THR_LOCK_DATA **ha_myisam::store_lock(Session *,
1594
1595
THR_LOCK_DATA **to,
1595
1596
enum thr_lock_type lock_type)
1597
1598
if (lock_type != TL_IGNORE && file->lock.type == TL_UNLOCK)
1598
1599
file->lock.type=lock_type;
1599
1600
*to++= &file->lock;
1603
void ha_myisam::update_create_info(HA_CREATE_INFO *create_info)
1605
ha_myisam::info(HA_STATUS_AUTO | HA_STATUS_CONST);
1606
if (!(create_info->used_fields & HA_CREATE_USED_AUTO))
1608
create_info->auto_increment_value= stats.auto_increment_value;
1610
create_info->data_file_name=data_file_name;
1611
create_info->index_file_name=index_file_name;
1615
int ha_myisam::create(const char *name, register Table *table_arg,
1616
HA_CREATE_INFO *ha_create_info)
1605
int MyisamEngine::createTableImplementation(Session *, const char *table_name,
1607
HA_CREATE_INFO *ha_create_info,
1608
drizzled::message::Table* create_proto)
1619
uint32_t create_flags= 0, records;
1611
uint32_t create_flags= 0, create_records;
1620
1612
char buff[FN_REFLEN];
1621
1613
MI_KEYDEF *keydef;
1622
1614
MI_COLUMNDEF *recinfo;
1623
1615
MI_CREATE_INFO create_info;
1624
TABLE_SHARE *share= table_arg->s;
1616
TableShare *share= table_arg->s;
1625
1617
uint32_t options= share->db_options_in_use;
1626
if ((error= table2myisam(table_arg, &keydef, &recinfo, &records)))
1618
if ((error= table2myisam(table_arg, &keydef, &recinfo, &create_records)))
1627
1619
return(error); /* purecov: inspected */
1628
1620
memset(&create_info, 0, sizeof(create_info));
1629
create_info.max_rows= share->max_rows;
1630
create_info.reloc_rows= share->min_rows;
1621
create_info.max_rows= create_proto->options().max_rows();
1622
create_info.reloc_rows= create_proto->options().min_rows();
1631
1623
create_info.with_auto_increment= share->next_number_key_offset == 0;
1632
1624
create_info.auto_increment= (ha_create_info->auto_increment_value ?
1633
1625
ha_create_info->auto_increment_value -1 :
1635
create_info.data_file_length= ((uint64_t) share->max_rows *
1636
share->avg_row_length);
1627
create_info.data_file_length= (create_proto->options().max_rows() *
1628
create_proto->options().avg_row_length());
1637
1629
create_info.data_file_name= ha_create_info->data_file_name;
1638
1630
create_info.index_file_name= ha_create_info->index_file_name;
1639
1631
create_info.language= share->table_charset->number;
1753
1742
return (uint)file->state->checksum;
1745
static MyisamEngine *engine= NULL;
1757
bool ha_myisam::check_if_incompatible_data(HA_CREATE_INFO *info,
1758
uint32_t table_changes)
1747
static int myisam_init(drizzled::plugin::Registry ®istry)
1760
uint32_t options= table->s->db_options_in_use;
1762
if (info->auto_increment_value != stats.auto_increment_value ||
1763
info->data_file_name != data_file_name ||
1764
info->index_file_name != index_file_name ||
1765
table_changes == IS_EQUAL_NO ||
1766
table_changes & IS_EQUAL_PACK_LENGTH) // Not implemented yet
1767
return COMPATIBLE_DATA_NO;
1769
if ((options & (HA_OPTION_PACK_RECORD | HA_OPTION_CHECKSUM |
1770
HA_OPTION_DELAY_KEY_WRITE)) !=
1771
(info->table_options & (HA_OPTION_PACK_RECORD | HA_OPTION_CHECKSUM |
1772
HA_OPTION_DELAY_KEY_WRITE)))
1773
return COMPATIBLE_DATA_NO;
1774
return COMPATIBLE_DATA_YES;
1750
engine= new MyisamEngine(engine_name);
1751
registry.add(engine);
1753
pthread_mutex_init(&THR_LOCK_myisam,MY_MUTEX_INIT_FAST);
1755
/* call ha_init_key_cache() on all key caches to init them */
1756
error= init_key_cache(dflt_key_cache,
1757
(uint32_t) dflt_key_cache->param_block_size,
1758
(uint32_t) dflt_key_cache->param_buff_size,
1759
dflt_key_cache->param_division_limit,
1760
dflt_key_cache->param_age_threshold);
1763
exit(1); /* Memory Allocation Failure */
1777
int myisam_deinit(void *hton __attribute__((unused)))
1768
static int myisam_deinit(drizzled::plugin::Registry ®istry)
1770
registry.remove(engine);
1773
pthread_mutex_destroy(&THR_LOCK_myisam);
1774
end_key_cache(dflt_key_cache, 1); // Can never fail
1779
1776
return mi_panic(HA_PANIC_CLOSE);
1782
static int myisam_init(void *p)
1784
handlerton *myisam_hton;
1786
myisam_hton= (handlerton *)p;
1787
myisam_hton->state= SHOW_OPTION_YES;
1788
myisam_hton->create= myisam_create_handler;
1789
myisam_hton->flags= HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES;
1795
/****************************************************************************
1796
* MyISAM MRR implementation: use DS-MRR
1797
***************************************************************************/
1799
int ha_myisam::multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
1800
uint32_t n_ranges, uint32_t mode,
1801
HANDLER_BUFFER *buf)
1803
return ds_mrr.dsmrr_init(this, &table->key_info[active_index],
1804
seq, seq_init_param, n_ranges, mode, buf);
1807
int ha_myisam::multi_range_read_next(char **range_info)
1809
return ds_mrr.dsmrr_next(this, range_info);
1812
ha_rows ha_myisam::multi_range_read_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
1813
void *seq_init_param,
1814
uint32_t n_ranges, uint32_t *bufsz,
1815
uint32_t *flags, COST_VECT *cost)
1818
This call is here because there is no location where this->table would
1820
TODO: consider moving it into some per-query initialization call.
1822
ds_mrr.init(this, table);
1823
return ds_mrr.dsmrr_info_const(keyno, seq, seq_init_param, n_ranges, bufsz,
1827
int ha_myisam::multi_range_read_info(uint32_t keyno, uint32_t n_ranges, uint32_t keys,
1828
uint32_t *bufsz, uint32_t *flags, COST_VECT *cost)
1830
ds_mrr.init(this, table);
1831
return ds_mrr.dsmrr_info(keyno, n_ranges, keys, bufsz, flags, cost);
1834
/* MyISAM MRR implementation ends */
1837
/* Index condition pushdown implementation*/
1840
Item *ha_myisam::idx_cond_push(uint32_t keyno_arg, Item* idx_cond_arg)
1842
pushed_idx_cond_keyno= keyno_arg;
1843
pushed_idx_cond= idx_cond_arg;
1844
in_range_check_pushed_down= true;
1845
if (active_index == pushed_idx_cond_keyno)
1846
mi_set_index_cond_func(file, index_cond_func_myisam, this);
1851
mysql_declare_plugin(myisam)
1853
DRIZZLE_STORAGE_ENGINE_PLUGIN,
1779
static DRIZZLE_SYSVAR_UINT(block_size, block_size,
1780
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
1781
N_("Block size to be used for MyISAM index pages."),
1782
NULL, NULL, MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH,
1783
MI_MAX_KEY_BLOCK_LENGTH, 0);
1785
static DRIZZLE_SYSVAR_UINT(repair_threads, repair_threads,
1786
PLUGIN_VAR_RQCMDARG,
1787
N_("Number of threads to use when repairing MyISAM tables. The value of "
1788
"1 disables parallel repair."),
1789
NULL, NULL, 1, 1, UINT32_MAX, 0);
1791
static DRIZZLE_SYSVAR_ULONGLONG(max_sort_file_size, max_sort_file_size,
1792
PLUGIN_VAR_RQCMDARG,
1793
N_("Don't use the fast sort index method to created index if the temporary file would get bigger than this."),
1794
NULL, NULL, INT32_MAX, 0, UINT64_MAX, 0);
1796
static DRIZZLE_SYSVAR_ULONGLONG(sort_buffer_size, sort_buffer_size,
1797
PLUGIN_VAR_RQCMDARG,
1798
N_("The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE."),
1799
NULL, NULL, 8192*1024, 1024, SIZE_MAX, 0);
1801
extern uint32_t data_pointer_size;
1802
static DRIZZLE_SYSVAR_UINT(data_pointer_size, data_pointer_size,
1803
PLUGIN_VAR_RQCMDARG,
1804
N_("Default pointer size to be used for MyISAM tables."),
1805
NULL, NULL, 6, 2, 7, 0);
1807
static struct st_mysql_sys_var* system_variables[]= {
1808
DRIZZLE_SYSVAR(block_size),
1809
DRIZZLE_SYSVAR(repair_threads),
1810
DRIZZLE_SYSVAR(max_sort_file_size),
1811
DRIZZLE_SYSVAR(sort_buffer_size),
1812
DRIZZLE_SYSVAR(data_pointer_size),
1817
drizzle_declare_plugin(myisam)