1133
1139
SHOW_VAR com_status_vars[]= {
1134
1140
{"admin_commands", (char*) offsetof(STATUS_VAR, com_other), SHOW_LONG_STATUS},
1141
{"assign_to_keycache", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_ASSIGN_TO_KEYCACHE]), SHOW_LONG_STATUS},
1135
1142
{"alter_db", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_ALTER_DB]), SHOW_LONG_STATUS},
1136
1143
{"alter_table", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_ALTER_TABLE]), SHOW_LONG_STATUS},
1137
1144
{"analyze", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_ANALYZE]), SHOW_LONG_STATUS},
1144
1151
{"create_index", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_CREATE_INDEX]), SHOW_LONG_STATUS},
1145
1152
{"create_table", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_CREATE_TABLE]), SHOW_LONG_STATUS},
1146
1153
{"delete", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_DELETE]), SHOW_LONG_STATUS},
1154
{"delete_multi", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_DELETE_MULTI]), SHOW_LONG_STATUS},
1147
1155
{"drop_db", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_DROP_DB]), SHOW_LONG_STATUS},
1148
1156
{"drop_index", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_DROP_INDEX]), SHOW_LONG_STATUS},
1149
1157
{"drop_table", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_DROP_TABLE]), SHOW_LONG_STATUS},
1171
1179
{"show_fields", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_FIELDS]), SHOW_LONG_STATUS},
1172
1180
{"show_keys", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_KEYS]), SHOW_LONG_STATUS},
1173
1181
{"show_open_tables", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_OPEN_TABLES]), SHOW_LONG_STATUS},
1182
{"show_plugins", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_PLUGINS]), SHOW_LONG_STATUS},
1174
1183
{"show_processlist", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_PROCESSLIST]), SHOW_LONG_STATUS},
1175
1184
{"show_status", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_STATUS]), SHOW_LONG_STATUS},
1176
1185
{"show_table_status", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_TABLE_STATUS]), SHOW_LONG_STATUS},
1180
1189
{"truncate", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_TRUNCATE]), SHOW_LONG_STATUS},
1181
1190
{"unlock_tables", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_UNLOCK_TABLES]), SHOW_LONG_STATUS},
1182
1191
{"update", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_UPDATE]), SHOW_LONG_STATUS},
1192
{"update_multi", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_UPDATE_MULTI]), SHOW_LONG_STATUS},
1183
1193
{NULL, NULL, SHOW_LONGLONG}
1281
1291
/* Set collactions that depends on the default collation */
1282
1292
global_system_variables.collation_server= default_charset_info;
1294
global_system_variables.optimizer_use_mrr= 1;
1284
1295
global_system_variables.optimizer_switch= 0;
1286
1297
if (!(character_set_filesystem=
1422
1436
"memory" engine which will be configurable longterm. We should be able to
1423
1437
remove partition and myisammrg.
1425
const std::string myisam_engine_name("MyISAM");
1426
const std::string heap_engine_name("MEMORY");
1427
myisam_engine= ha_resolve_by_name(NULL, myisam_engine_name);
1428
heap_engine= ha_resolve_by_name(NULL, heap_engine_name);
1439
const LEX_STRING myisam_engine_name= { C_STRING_WITH_LEN("MyISAM") };
1440
const LEX_STRING heap_engine_name= { C_STRING_WITH_LEN("MEMORY") };
1441
myisam_engine= ha_resolve_by_name(NULL, &myisam_engine_name);
1442
heap_engine= ha_resolve_by_name(NULL, &heap_engine_name);
1431
1445
Check that the default storage engine is actually available.
1433
1447
if (default_storage_engine_str)
1435
const std::string name(default_storage_engine_str);
1449
LEX_STRING name= { default_storage_engine_str,
1450
strlen(default_storage_engine_str) };
1436
1451
StorageEngine *engine;
1438
engine= ha_resolve_by_name(0, name);
1453
if (!(engine= ha_resolve_by_name(0, &name)))
1441
1455
errmsg_printf(ERRMSG_LVL_ERROR, _("Unknown/unsupported table type: %s"),
1442
1456
default_storage_engine_str);
1684
1698
OPT_TC_HEURISTIC_RECOVER,
1699
OPT_ENGINE_CONDITION_PUSHDOWN,
1685
1700
OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_COMPLETION_TYPE,
1686
1701
OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS,
1803
1819
(char**) &opt_do_pstack, (char**) &opt_do_pstack, 0, GET_BOOL, NO_ARG, 0, 0,
1805
1821
#endif /* HAVE_STACK_TRACE_ON_SEGV */
1822
{"engine-condition-pushdown",
1823
OPT_ENGINE_CONDITION_PUSHDOWN,
1824
N_("Push supported query conditions to the storage engine."),
1825
(char**) &global_system_variables.engine_condition_pushdown,
1826
(char**) &global_system_variables.engine_condition_pushdown,
1827
0, GET_BOOL, NO_ARG, false, 0, 0, 0, 0, 0},
1806
1828
/* See how it's handled in get_one_option() */
1807
1829
{"exit-info", 'T',
1808
1830
N_("Used for debugging; Use at your own risk!"),
1930
1952
"writes) to as much as you can afford;"),
1931
1953
(char**) &dflt_key_cache_var.param_buff_size,
1955
0, (GET_ULL | GET_ASK_ADDR),
1934
1956
REQUIRED_ARG, KEY_CACHE_SIZE, MALLOC_OVERHEAD, SIZE_T_MAX, MALLOC_OVERHEAD,
1936
1958
{"key_cache_age_threshold", OPT_KEY_CACHE_AGE_THRESHOLD,
1940
1962
"total number of blocks in key cache"),
1941
1963
(char**) &dflt_key_cache_var.param_age_threshold,
1943
0, (GET_UINT32), REQUIRED_ARG,
1965
0, (GET_UINT32 | GET_ASK_ADDR), REQUIRED_ARG,
1944
1966
300, 100, ULONG_MAX, 0, 100, 0},
1945
1967
{"key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE,
1946
1968
N_("The default size of key cache blocks"),
1947
1969
(char**) &dflt_key_cache_var.param_block_size,
1949
0, (GET_UINT32), REQUIRED_ARG,
1971
0, (GET_UINT32 | GET_ASK_ADDR), REQUIRED_ARG,
1950
1972
KEY_CACHE_BLOCK_SIZE, 512, 1024 * 16, 0, 512, 0},
1951
1973
{"key_cache_division_limit", OPT_KEY_CACHE_DIVISION_LIMIT,
1952
1974
N_("The minimum percentage of warm blocks in key cache"),
1953
1975
(char**) &dflt_key_cache_var.param_division_limit,
1955
0, (GET_UINT32) , REQUIRED_ARG, 100,
1977
0, (GET_UINT32 | GET_ASK_ADDR) , REQUIRED_ARG, 100,
1956
1978
1, 100, 0, 1, 0},
1957
1979
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
1958
1980
N_("Max packetlength to send/receive from to server."),
2058
2080
(char**) &global_system_variables.optimizer_search_depth,
2059
2081
(char**) &max_system_variables.optimizer_search_depth,
2060
2082
0, GET_UINT, OPT_ARG, MAX_TABLES+1, 0, MAX_TABLES+2, 0, 1, 0},
2083
{"optimizer_use_mrr", OPT_OPTIMIZER_USE_MRR,
2084
N_("Should the Optmizer use MRR or not. "
2085
"Valid values are auto, force and disable"),
2086
0, 0, 0, GET_STR, REQUIRED_ARG, 0,
2061
2088
{"plugin_dir", OPT_PLUGIN_DIR,
2062
2089
N_("Directory for plugins."),
2063
2090
(char**) &opt_plugin_dir_ptr, (char**) &opt_plugin_dir_ptr, 0,
2363
2390
myisam_stats_method_str= "nulls_unequal";
2364
2391
session_list.clear();
2393
if (!(dflt_key_cache= get_or_create_key_cache(default_key_cache_base.str,
2394
default_key_cache_base.length)))
2396
/* set key_cache_hash.default_value = dflt_key_cache */
2397
multi_keycache_init();
2366
2399
/* Set directory paths */
2367
2400
strncpy(language, LANGUAGE, sizeof(language)-1);
2519
2552
global_system_variables.tx_isolation= (type-1);
2555
case OPT_OPTIMIZER_USE_MRR:
2558
type= find_type_or_exit(argument, &optimizer_use_mrr_typelib, opt->name);
2559
global_system_variables.optimizer_use_mrr= (type-1);
2522
2562
case OPT_TC_HEURISTIC_RECOVER:
2523
2563
tc_heuristic_recover= find_type_or_exit(argument,
2524
2564
&tc_heuristic_recover_typelib,
2595
/** Handle arguments for multiple key caches. */
2597
extern "C" char **drizzle_getopt_value(const char *keyname, uint32_t key_length,
2598
const struct my_option *option);
2601
drizzle_getopt_value(const char *keyname, uint32_t key_length,
2602
const struct my_option *option)
2604
switch (option->id) {
2605
case OPT_KEY_BUFFER_SIZE:
2606
case OPT_KEY_CACHE_BLOCK_SIZE:
2607
case OPT_KEY_CACHE_DIVISION_LIMIT:
2608
case OPT_KEY_CACHE_AGE_THRESHOLD:
2610
KEY_CACHE *key_cache;
2611
if (!(key_cache= get_or_create_key_cache(keyname, key_length)))
2613
switch (option->id) {
2614
case OPT_KEY_BUFFER_SIZE:
2615
return (char**) &key_cache->param_buff_size;
2616
case OPT_KEY_CACHE_BLOCK_SIZE:
2617
return (char**) &key_cache->param_block_size;
2618
case OPT_KEY_CACHE_DIVISION_LIMIT:
2619
return (char**) &key_cache->param_division_limit;
2620
case OPT_KEY_CACHE_AGE_THRESHOLD:
2621
return (char**) &key_cache->param_age_threshold;
2625
return (char **)option->value;
2555
2629
extern "C" void option_error_reporter(enum loglevel level, const char *format, ...);
2557
2631
void option_error_reporter(enum loglevel level, const char *format, ...)
2723
2798
/* Used templates */
2724
2799
template class I_List<i_string>;
2725
2800
template class I_List<i_string_pair>;
2801
template class I_List<NAMED_LIST>;
2726
2802
template class I_List<Statement>;
2727
2803
template class I_List_iterator<Statement>;