160
176
#endif /* MYSQL_DYNAMIC_PLUGIN && __WIN__ */
162
178
static plugin::XaStorageEngine* innodb_engine_ptr= NULL;
164
typedef constrained_check<uint32_t, UINT32_MAX, 10> open_files_constraint;
165
static open_files_constraint innobase_open_files;
166
typedef constrained_check<uint32_t, 10, 1> mirrored_log_groups_constraint;
167
static mirrored_log_groups_constraint innobase_mirrored_log_groups;
168
typedef constrained_check<uint32_t, 100, 2> log_files_in_group_constraint;
169
static log_files_in_group_constraint innobase_log_files_in_group;
170
typedef constrained_check<uint32_t, 6, 0> force_recovery_constraint;
171
force_recovery_constraint innobase_force_recovery;
172
typedef constrained_check<size_t, SIZE_MAX, 256*1024, 1024> log_buffer_constraint;
173
static log_buffer_constraint innobase_log_buffer_size;
174
typedef constrained_check<size_t, SIZE_MAX, 512*1024, 1024> additional_mem_pool_constraint;
175
static additional_mem_pool_constraint innobase_additional_mem_pool_size;
176
typedef constrained_check<unsigned int, 1000, 1> autoextend_constraint;
177
static autoextend_constraint innodb_auto_extend_increment;
178
typedef constrained_check<size_t, SIZE_MAX, 5242880, 1048576> buffer_pool_constraint;
179
static buffer_pool_constraint innobase_buffer_pool_size;
180
typedef constrained_check<uint32_t, MAX_BUFFER_POOLS, 1> buffer_pool_instances_constraint;
181
static buffer_pool_instances_constraint innobase_buffer_pool_instances;
182
typedef constrained_check<uint32_t, UINT32_MAX, 100> io_capacity_constraint;
183
static io_capacity_constraint innodb_io_capacity;
184
typedef constrained_check<uint32_t, 5000, 1> purge_batch_constraint;
185
static purge_batch_constraint innodb_purge_batch_size;
186
typedef constrained_check<uint32_t, 1, 0> purge_threads_constraint;
187
static purge_threads_constraint innodb_n_purge_threads;
188
typedef constrained_check<uint32_t, 2, 0> trinary_constraint;
189
static trinary_constraint innodb_flush_log_at_trx_commit;
190
typedef constrained_check<unsigned int, 99, 0> max_dirty_pages_constraint;
191
static max_dirty_pages_constraint innodb_max_dirty_pages_pct;
192
static uint64_constraint innodb_max_purge_lag;
193
static uint64_nonzero_constraint innodb_stats_sample_pages;
194
typedef constrained_check<uint32_t, 64, 1> io_threads_constraint;
195
static io_threads_constraint innobase_read_io_threads;
196
static io_threads_constraint innobase_write_io_threads;
198
typedef constrained_check<uint32_t, 1000, 0> concurrency_constraint;
199
static concurrency_constraint innobase_commit_concurrency;
200
static concurrency_constraint innobase_thread_concurrency;
201
static uint32_nonzero_constraint innodb_concurrency_tickets;
203
typedef constrained_check<int64_t, INT64_MAX, 1024*1024, 1024*1024> log_file_constraint;
204
static log_file_constraint innobase_log_file_size;
206
static uint64_constraint innodb_replication_delay;
208
/** Percentage of the buffer pool to reserve for 'old' blocks.
209
Connected to buf_LRU_old_ratio. */
210
typedef constrained_check<uint32_t, 95, 5> old_blocks_constraint;
211
static old_blocks_constraint innobase_old_blocks_pct;
213
static uint32_constraint innodb_sync_spin_loops;
214
static uint32_constraint innodb_spin_wait_delay;
215
static uint32_constraint innodb_thread_sleep_delay;
217
typedef constrained_check<uint32_t, 64, 0> read_ahead_threshold_constraint;
218
static read_ahead_threshold_constraint innodb_read_ahead_threshold;
179
static plugin::TableFunction* status_table_function_ptr= NULL;
180
static plugin::TableFunction* cmp_tool= NULL;
181
static plugin::TableFunction* cmp_reset_tool= NULL;
182
static plugin::TableFunction* cmp_mem_tool= NULL;
183
static plugin::TableFunction* cmp_mem_reset_tool= NULL;
184
static plugin::TableFunction* innodb_trx_tool= NULL;
185
static plugin::TableFunction* innodb_locks_tool= NULL;
186
static plugin::TableFunction* innodb_lock_waits_tool= NULL;
188
static long innobase_mirrored_log_groups, innobase_log_files_in_group,
189
innobase_log_buffer_size,
190
innobase_file_io_threads,
191
innobase_force_recovery, innobase_open_files;
192
static long innobase_additional_mem_pool_size= 8*1024*1024L;
193
static ulong innobase_commit_concurrency = 0;
194
static ulong innobase_read_io_threads;
195
static ulong innobase_write_io_threads;
198
* @TODO: Turn this into size_t as soon as we have a Variable<size_t>
200
static int64_t innobase_buffer_pool_size= 128*1024*1024;
201
static int64_t innobase_log_file_size;
220
203
/* The default values for the following char* start-up parameters
221
204
are determined in innobase_init below: */
223
std::string innobase_data_home_dir;
224
std::string innobase_data_file_path;
225
std::string innobase_log_group_home_dir;
226
static string innobase_file_format_name;
227
static string innobase_change_buffering;
229
/* The highest file format being used in the database. The value can be
230
set by user, however, it will be adjusted to the newer file format if
231
a table of such format is created/opened. */
232
static string innobase_file_format_max;
206
static char* innobase_data_home_dir = NULL;
207
static char* innobase_data_file_path = NULL;
208
static char* innobase_log_group_home_dir = NULL;
209
static char* innobase_file_format_name = NULL;
210
static char* innobase_change_buffering = NULL;
212
/* Note: This variable can be set to on/off and any of the supported
213
file formats in the configuration file, but can only be set to any
214
of the supported file formats during runtime. */
215
static char* innobase_file_format_check = NULL;
217
/* The following has a misleading name: starting from 4.0.5, this also
219
static char* innobase_unix_file_flush_method = NULL;
234
221
/* Below we have boolean-valued start-up parameters, and their default
237
typedef constrained_check<uint32_t, 2, 0> trinary_constraint;
238
static trinary_constraint innobase_fast_shutdown;
240
/* "innobase_file_format_check" decides whether we would continue
241
booting the server if the file format stamped on the system
242
table space exceeds the maximum file format supported
243
by the server. Can be set during server startup at command
244
line or configure file, and a read only variable after
247
/* If a new file format is introduced, the file format
248
name needs to be updated accordingly. Please refer to
249
file_format_name_map[] defined in trx0sys.c for the next
252
static my_bool innobase_file_format_check = TRUE;
224
static ulong innobase_fast_shutdown = 1;
225
#ifdef UNIV_LOG_ARCHIVE
226
static my_bool innobase_log_archive = FALSE;
227
static char* innobase_log_arch_dir = NULL;
228
#endif /* UNIV_LOG_ARCHIVE */
253
229
static my_bool innobase_use_doublewrite = TRUE;
254
230
static my_bool innobase_use_checksums = TRUE;
255
231
static my_bool innobase_rollback_on_timeout = FALSE;
256
232
static my_bool innobase_create_status_file = FALSE;
257
static bool innobase_use_replication_log;
258
static bool support_xa;
259
static bool strict_mode;
260
typedef constrained_check<uint32_t, 1024*1024*1024, 1> lock_wait_constraint;
261
static lock_wait_constraint lock_wait_timeout;
233
static my_bool innobase_stats_on_metadata = TRUE;
263
235
static char* internal_innobase_data_file_path = NULL;
237
static char* innodb_version_str = (char*) INNODB_VERSION_STR;
265
239
/* The following counter is used to convey information to InnoDB
266
240
about server activity: in selects it is not sensible to call
267
241
srv_active_wake_master_thread after each fetch or search, we only do
2014
1844
module::Context &context) /*!< in: Drizzle Plugin Context */
1846
static char current_dir[3]; /*!< Set if using current lib */
2018
1850
uint format_id;
2019
1851
InnobaseEngine *actuall_engine_ptr;
2020
1852
const module::option_map &vm= context.getOptions();
2022
srv_auto_extend_increment= innodb_auto_extend_increment.get();
2023
srv_io_capacity= innodb_io_capacity.get();
2024
srv_purge_batch_size= innodb_purge_batch_size.get();
2025
srv_n_purge_threads= innodb_n_purge_threads.get();
2026
srv_flush_log_at_trx_commit= innodb_flush_log_at_trx_commit.get();
2027
srv_max_buf_pool_modified_pct= innodb_max_dirty_pages_pct.get();
2028
srv_max_purge_lag= innodb_max_purge_lag.get();
2029
srv_stats_sample_pages= innodb_stats_sample_pages.get();
2030
srv_n_free_tickets_to_enter= innodb_concurrency_tickets.get();
2031
srv_replication_delay= innodb_replication_delay.get();
2032
srv_thread_concurrency= innobase_thread_concurrency.get();
2033
srv_n_spin_wait_rounds= innodb_sync_spin_loops.get();
2034
srv_spin_wait_delay= innodb_spin_wait_delay.get();
2035
srv_thread_sleep_delay= innodb_thread_sleep_delay.get();
2036
srv_read_ahead_threshold= innodb_read_ahead_threshold.get();
2038
/* Inverted Booleans */
2040
innobase_use_checksums= (vm.count("disable-checksums")) ? false : true;
2041
innobase_use_doublewrite= (vm.count("disable-doublewrite")) ? false : true;
2042
srv_adaptive_flushing= (vm.count("disable-adaptive-flushing")) ? false : true;
2043
srv_use_sys_malloc= (vm.count("use-internal-malloc")) ? false : true;
2044
srv_use_native_aio= (vm.count("disable-native-aio")) ? false : true;
2045
support_xa= (vm.count("disable-xa")) ? false : true;
2046
btr_search_enabled= (vm.count("disable-adaptive-hash-index")) ? false : true;
2049
/* Hafta do this here because we need to late-bind the default value */
1854
if (vm.count("io-capacity"))
1856
if (srv_io_capacity < 100)
1858
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for io-capacity\n"));
2050
1863
if (vm.count("data-home-dir"))
2052
innobase_data_home_dir= vm["data-home-dir"].as<string>();
2056
innobase_data_home_dir= getDataHome().file_string();
1865
innobase_data_home_dir= strdup(vm["data-home-dir"].as<string>().c_str());
1870
innobase_data_home_dir= NULL;
1873
if (vm.count("fast-shutdown"))
1875
if (innobase_fast_shutdown > 2)
1877
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for fast-shutdown\n"));
1882
if (vm.count("file-format-check"))
1884
innobase_file_format_check= const_cast<char *>(vm["file-format-check"].as<string>().c_str());
1887
if (vm.count("flush-log-at-trx-commit"))
1889
if (srv_flush_log_at_trx_commit > 2)
1891
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for flush-log-at-trx-commit\n"));
1896
if (vm.count("flush-method"))
1898
innobase_unix_file_flush_method= const_cast<char *>(vm["flush-method"].as<string>().c_str());
1902
innobase_unix_file_flush_method= NULL;
1905
#ifdef UNIV_LOG_ARCHIVE
1906
if (vm.count("log-arch-dir"))
1908
innobase_log_arch_dir= const_cast<char *>(vm["log-arch-dir"].as<string>().c_str());
1913
innobase_log_arch_dir= NULL;
1915
#endif /* UNIV_LOG_ARCHIVE */
1917
if (vm.count("max-dirty-pages-pct"))
1919
if (srv_max_buf_pool_modified_pct > 99)
1921
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for max-dirty-pages-pct\n"));
1926
if (vm.count("stats-sample-pages"))
1928
if (srv_stats_sample_pages < 8)
1930
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for stats-sample-pages\n"));
1935
if (vm.count("additional-mem-pool-size"))
1937
align_value(innobase_additional_mem_pool_size);
1939
if (innobase_additional_mem_pool_size < 512*1024L)
1941
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for additional-mem-pool-size\n"));
1947
if (vm.count("autoextend-increment"))
1949
if (srv_auto_extend_increment < 1 || srv_auto_extend_increment > 1000)
1951
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for autoextend-increment\n"));
1956
if (vm.count("buffer-pool-size"))
1958
align_value(innobase_buffer_pool_size, 1024*1024);
1959
if (innobase_buffer_pool_size < 5*1024*1024)
1961
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for buffer-pool-size\n"));
1967
if (vm.count("commit-concurrency"))
1969
if (srv_replication_delay > 1000)
1971
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for commit-concurrency\n"));
1976
if (vm.count("concurrency-tickets"))
1978
if (srv_n_free_tickets_to_enter < 1)
1980
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for concurrency-tickets\n"));
1985
if (vm.count("file-io-threads"))
1987
if (innobase_file_io_threads < 4 || innobase_file_io_threads > 64)
1989
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for file-io-threads\n"));
1994
if (vm.count("read-io-threads"))
1996
if (innobase_read_io_threads < 1 || innobase_read_io_threads > 64)
1998
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for read-io-threads\n"));
2003
if (vm.count("write-io-threads"))
2005
if (innobase_write_io_threads < 1 || innobase_write_io_threads > 64)
2007
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for write-io-threads\n"));
2012
if (vm.count("force-recovery"))
2014
if (innobase_force_recovery > 6)
2016
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for force-recovery\n"));
2021
if (vm.count("log-buffer-size"))
2023
align_value(innobase_log_buffer_size);
2024
if (innobase_log_buffer_size < 256*1024L)
2026
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for log-file-size\n"));
2031
if (vm.count("log-file-size"))
2033
align_value(innobase_log_file_size, 1024*1024);
2034
if (innobase_log_file_size < 1*1024*1024L)
2036
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for log-file-size\n"));
2041
if (vm.count("log-files-in-group"))
2043
if (innobase_log_files_in_group < 2 || innobase_log_files_in_group > 100)
2045
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for log-files-in-group\n"));
2050
if (vm.count("mirrored-log-groups"))
2052
if (innobase_mirrored_log_groups < 1 || innobase_mirrored_log_groups > 10)
2054
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for mirrored-log-groups\n"));
2059
if (vm.count("open-files"))
2061
if (innobase_open_files < 10)
2063
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for open-files\n"));
2068
if (vm.count("thread-concurrency"))
2070
if (srv_thread_concurrency > 1000)
2072
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for thread-concurrency\n"));
2060
2077
if (vm.count("data-file-path"))
2062
innobase_data_file_path= vm["data-file-path"].as<string>();
2079
innobase_data_file_path= const_cast<char *>(vm["data-file-path"].as<string>().c_str());
2083
innobase_data_file_path= NULL;
2086
if (vm.count("version"))
2088
innodb_version_str= const_cast<char *>(vm["version"].as<string>().c_str());
2091
if (vm.count("read-ahead-threshold"))
2093
if (srv_read_ahead_threshold > 64)
2095
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for read-ahead-threshold\n"));
2100
if (vm.count("support-xa"))
2102
(SessionVAR(NULL,support_xa))= vm["support-xa"].as<bool>();
2105
if (vm.count("table-locks"))
2107
(SessionVAR(NULL,table_locks))= vm["table-locks"].as<bool>();
2110
if (vm.count("strict-mode"))
2112
(SessionVAR(NULL,strict_mode))= vm["strict-mode"].as<bool>();
2115
if (vm.count("lock-wait-timeout"))
2117
if (vm["lock-wait-timeout"].as<unsigned long>() < 1 || vm["lock-wait-timeout"].as<unsigned long>() > 1024*1024*1024)
2119
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for lock-wait-timeout\n"));
2123
(SessionVAR(NULL,lock_wait_timeout))= vm["lock-wait-timeout"].as<unsigned long>();
2066
2126
innodb_engine_ptr= actuall_engine_ptr= new InnobaseEngine(innobase_engine_name);
2269
2388
err = innobase_start_or_create_for_mysql();
2271
if (err != DB_SUCCESS)
2273
goto mem_free_and_error;
2276
err = dict_create_sys_replication_log();
2278
2390
if (err != DB_SUCCESS) {
2279
2391
goto mem_free_and_error;
2283
innobase_old_blocks_pct = buf_LRU_old_ratio_update(innobase_old_blocks_pct.get(),
2286
2394
innobase_open_tables = hash_create(200);
2395
pthread_mutex_init(&innobase_share_mutex, MY_MUTEX_INIT_FAST);
2396
pthread_mutex_init(&prepare_commit_mutex, MY_MUTEX_INIT_FAST);
2397
pthread_mutex_init(&commit_threads_m, MY_MUTEX_INIT_FAST);
2398
pthread_mutex_init(&commit_cond_m, MY_MUTEX_INIT_FAST);
2399
pthread_cond_init(&commit_cond, NULL);
2287
2400
innodb_inited= 1;
2289
2402
actuall_engine_ptr->dropTemporarySchema();
2291
context.add(new InnodbStatusTool);
2404
status_table_function_ptr= new InnodbStatusTool;
2293
2406
context.add(innodb_engine_ptr);
2295
context.add(new(std::nothrow)CmpTool(false));
2297
context.add(new(std::nothrow)CmpTool(true));
2299
context.add(new(std::nothrow)CmpmemTool(false));
2301
context.add(new(std::nothrow)CmpmemTool(true));
2303
context.add(new(std::nothrow)InnodbTrxTool("INNODB_TRX"));
2305
context.add(new(std::nothrow)InnodbTrxTool("INNODB_LOCKS"));
2307
context.add(new(std::nothrow)InnodbTrxTool("INNODB_LOCK_WAITS"));
2309
context.add(new(std::nothrow)InnodbSysTablesTool());
2311
context.add(new(std::nothrow)InnodbSysTableStatsTool());
2313
context.add(new(std::nothrow)InnodbSysIndexesTool());
2315
context.add(new(std::nothrow)InnodbSysColumnsTool());
2317
context.add(new(std::nothrow)InnodbSysFieldsTool());
2319
context.add(new(std::nothrow)InnodbSysForeignTool());
2321
context.add(new(std::nothrow)InnodbSysForeignColsTool());
2408
context.add(status_table_function_ptr);
2410
cmp_tool= new(std::nothrow)CmpTool(false);
2411
context.add(cmp_tool);
2413
cmp_reset_tool= new(std::nothrow)CmpTool(true);
2414
context.add(cmp_reset_tool);
2416
cmp_mem_tool= new(std::nothrow)CmpmemTool(false);
2417
context.add(cmp_mem_tool);
2419
cmp_mem_reset_tool= new(std::nothrow)CmpmemTool(true);
2420
context.add(cmp_mem_reset_tool);
2422
innodb_trx_tool= new(std::nothrow)InnodbTrxTool("INNODB_TRX");
2423
context.add(innodb_trx_tool);
2425
innodb_locks_tool= new(std::nothrow)InnodbTrxTool("INNODB_LOCKS");
2426
context.add(innodb_locks_tool);
2428
innodb_lock_waits_tool= new(std::nothrow)InnodbTrxTool("INNODB_LOCK_WAITS");
2429
context.add(innodb_lock_waits_tool);
2323
2431
context.add(new(std::nothrow)InnodbInternalTables());
2324
context.add(new(std::nothrow)InnodbReplicationTable());
2326
if (innobase_use_replication_log)
2328
ReplicationLog *replication_logger= new(std::nothrow)ReplicationLog();
2329
context.add(replication_logger);
2330
ReplicationLog::setup(replication_logger);
2333
context.registerVariable(new sys_var_const_string_val("data-home-dir", innobase_data_home_dir));
2334
context.registerVariable(new sys_var_const_string_val("flush-method",
2335
vm.count("flush-method") ? vm["flush-method"].as<string>() : ""));
2336
context.registerVariable(new sys_var_const_string_val("log-group-home-dir", innobase_log_group_home_dir));
2337
context.registerVariable(new sys_var_const_string_val("data-file-path", innobase_data_file_path));
2338
context.registerVariable(new sys_var_const_string_val("version", vm["version"].as<string>()));
2341
context.registerVariable(new sys_var_bool_ptr_readonly("replication_log", &innobase_use_replication_log));
2342
context.registerVariable(new sys_var_bool_ptr_readonly("checksums", &innobase_use_checksums));
2343
context.registerVariable(new sys_var_bool_ptr_readonly("doublewrite", &innobase_use_doublewrite));
2344
context.registerVariable(new sys_var_bool_ptr("file-per-table", &srv_file_per_table));
2345
context.registerVariable(new sys_var_bool_ptr_readonly("file-format-check", &innobase_file_format_check));
2346
context.registerVariable(new sys_var_bool_ptr("adaptive-flushing", &srv_adaptive_flushing));
2347
context.registerVariable(new sys_var_bool_ptr("status-file", &innobase_create_status_file));
2348
context.registerVariable(new sys_var_bool_ptr_readonly("use-sys-malloc", &srv_use_sys_malloc));
2349
context.registerVariable(new sys_var_bool_ptr_readonly("use-native-aio", &srv_use_native_aio));
2351
context.registerVariable(new sys_var_bool_ptr("support-xa", &support_xa));
2352
context.registerVariable(new sys_var_bool_ptr("strict_mode", &strict_mode));
2353
context.registerVariable(new sys_var_constrained_value<uint32_t>("lock_wait_timeout", lock_wait_timeout));
2355
context.registerVariable(new sys_var_constrained_value_readonly<size_t>("additional_mem_pool_size",innobase_additional_mem_pool_size));
2356
context.registerVariable(new sys_var_constrained_value<uint32_t>("autoextend_increment",
2357
innodb_auto_extend_increment,
2358
auto_extend_update));
2359
context.registerVariable(new sys_var_constrained_value<uint32_t>("io_capacity",
2361
io_capacity_update));
2362
context.registerVariable(new sys_var_constrained_value<uint32_t>("purge_batch_size",
2363
innodb_purge_batch_size,
2364
purge_batch_update));
2365
context.registerVariable(new sys_var_constrained_value<uint32_t>("purge_threads",
2366
innodb_n_purge_threads,
2367
purge_threads_update));
2368
context.registerVariable(new sys_var_constrained_value<uint32_t>("fast_shutdown", innobase_fast_shutdown));
2369
context.registerVariable(new sys_var_std_string("file_format",
2370
innobase_file_format_name,
2371
innodb_file_format_name_validate));
2372
context.registerVariable(new sys_var_std_string("change_buffering",
2373
innobase_change_buffering,
2374
innodb_change_buffering_validate));
2375
context.registerVariable(new sys_var_std_string("file_format_max",
2376
innobase_file_format_max,
2377
innodb_file_format_max_validate));
2378
context.registerVariable(new sys_var_constrained_value_readonly<size_t>("buffer_pool_size", innobase_buffer_pool_size));
2379
context.registerVariable(new sys_var_constrained_value_readonly<int64_t>("log_file_size", innobase_log_file_size));
2380
context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("flush_log_at_trx_commit",
2381
innodb_flush_log_at_trx_commit));
2382
context.registerVariable(new sys_var_constrained_value_readonly<unsigned int>("max_dirty_pages_pct",
2383
innodb_max_dirty_pages_pct));
2384
context.registerVariable(new sys_var_constrained_value_readonly<uint64_t>("max_purge_lag", innodb_max_purge_lag));
2385
context.registerVariable(new sys_var_constrained_value_readonly<uint64_t>("stats_sample_pages", innodb_stats_sample_pages));
2386
context.registerVariable(new sys_var_bool_ptr("adaptive_hash_index", &btr_search_enabled, innodb_adaptive_hash_index_update));
2388
context.registerVariable(new sys_var_constrained_value<uint32_t>("commit_concurrency",
2389
innobase_commit_concurrency,
2390
innodb_commit_concurrency_validate));
2391
context.registerVariable(new sys_var_constrained_value<uint32_t>("concurrency_tickets",
2392
innodb_concurrency_tickets));
2393
context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("read_io_threads", innobase_read_io_threads));
2394
context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("write_io_threads", innobase_write_io_threads));
2395
context.registerVariable(new sys_var_constrained_value_readonly<uint64_t>("replication_delay", innodb_replication_delay));
2396
context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("force_recovery", innobase_force_recovery));
2397
context.registerVariable(new sys_var_constrained_value_readonly<size_t>("log_buffer_size", innobase_log_buffer_size));
2398
context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("log_files_in_group", innobase_log_files_in_group));
2399
context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("mirrored_log_groups", innobase_mirrored_log_groups));
2400
context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("open_files", innobase_open_files));
2401
context.registerVariable(new sys_var_constrained_value<uint32_t>("old_blocks_pct",
2402
innobase_old_blocks_pct,
2403
innodb_old_blocks_pct_update));
2404
context.registerVariable(new sys_var_uint32_t_ptr("old_blocks_time", &buf_LRU_old_threshold_ms));
2405
context.registerVariable(new sys_var_constrained_value<uint32_t>("sync_spin_loops", innodb_sync_spin_loops, innodb_sync_spin_loops_update));
2406
context.registerVariable(new sys_var_constrained_value<uint32_t>("spin_wait_delay", innodb_spin_wait_delay, innodb_spin_wait_delay_update));
2407
context.registerVariable(new sys_var_constrained_value<uint32_t>("thread_sleep_delay", innodb_thread_sleep_delay, innodb_thread_sleep_delay_update));
2408
context.registerVariable(new sys_var_constrained_value<uint32_t>("thread_concurrency",
2409
innobase_thread_concurrency,
2410
innodb_thread_concurrency_update));
2411
context.registerVariable(new sys_var_constrained_value<uint32_t>("read_ahead_threshold",
2412
innodb_read_ahead_threshold,
2413
innodb_read_ahead_threshold_update));
2414
2433
/* Get the current high water mark format. */
2415
innobase_file_format_max = trx_sys_file_format_max_get();
2416
btr_search_fully_disabled = (!btr_search_enabled);
2434
innobase_file_format_check = (char*) trx_sys_file_format_max_get();
2879
/********************************************************************//**
2880
Get the upper limit of the MySQL integral and floating-point type.
2881
@return maximum allowed value for the field */
2884
innobase_get_int_col_max_value(
2885
/*===========================*/
2886
const Field* field) /*!< in: MySQL field */
2888
uint64_t max_value = 0;
2890
switch(field->key_type()) {
2892
case HA_KEYTYPE_BINARY:
2893
max_value = 0xFFULL;
2896
case HA_KEYTYPE_ULONG_INT:
2897
max_value = 0xFFFFFFFFULL;
2899
case HA_KEYTYPE_LONG_INT:
2900
max_value = 0x7FFFFFFFULL;
2903
case HA_KEYTYPE_ULONGLONG:
2904
max_value = 0xFFFFFFFFFFFFFFFFULL;
2906
case HA_KEYTYPE_LONGLONG:
2907
max_value = 0x7FFFFFFFFFFFFFFFULL;
2909
case HA_KEYTYPE_DOUBLE:
2910
/* We use the maximum as per IEEE754-2008 standard, 2^53 */
2911
max_value = 0x20000000000000ULL;
2920
/*******************************************************************//**
2921
This function checks whether the index column information
2922
is consistent between KEY info from mysql and that from innodb index.
2923
@return TRUE if all column types match. */
2926
innobase_match_index_columns(
2927
/*=========================*/
2928
const KeyInfo* key_info, /*!< in: Index info
2930
const dict_index_t* index_info) /*!< in: Index info
2933
const KeyPartInfo* key_part;
2934
const KeyPartInfo* key_end;
2935
const dict_field_t* innodb_idx_fld;
2936
const dict_field_t* innodb_idx_fld_end;
2938
/* Check whether user defined index column count matches */
2939
if (key_info->key_parts != index_info->n_user_defined_cols) {
2943
key_part = key_info->key_part;
2944
key_end = key_part + key_info->key_parts;
2945
innodb_idx_fld = index_info->fields;
2946
innodb_idx_fld_end = index_info->fields + index_info->n_fields;
2948
/* Check each index column's datatype. We do not check
2949
column name because there exists case that index
2950
column name got modified in mysql but such change does not
2951
propagate to InnoDB.
2952
One hidden assumption here is that the index column sequences
2953
are matched up between those in mysql and Innodb. */
2954
for (; key_part != key_end; ++key_part) {
2957
ulint mtype = innodb_idx_fld->col->mtype;
2959
/* Need to translate to InnoDB column type before
2961
col_type = get_innobase_type_from_mysql_type(&is_unsigned,
2964
/* Ignore Innodb specific system columns. */
2965
while (mtype == DATA_SYS) {
2968
if (innodb_idx_fld >= innodb_idx_fld_end) {
2973
if (col_type != mtype) {
2974
/* Column Type mismatches */
2984
/*******************************************************************//**
2985
This function builds a translation table in INNOBASE_SHARE
2986
structure for fast index location with mysql array number from its
2987
table->key_info structure. This also provides the necessary translation
2988
between the key order in mysql key_info and Innodb ib_table->indexes if
2989
they are not fully matched with each other.
2990
Note we do not have any mutex protecting the translation table
2991
building based on the assumption that there is no concurrent
2992
index creation/drop and DMLs that requires index lookup. All table
2993
handle will be closed before the index creation/drop.
2994
@return TRUE if index translation table built successfully */
2997
innobase_build_index_translation(
2998
/*=============================*/
2999
const Table* table, /*!< in: table in MySQL data
3001
dict_table_t* ib_table, /*!< in: table in Innodb data
3003
INNOBASE_SHARE* share) /*!< in/out: share structure
3004
where index translation table
3005
will be constructed in. */
3007
ulint mysql_num_index;
3009
dict_index_t** index_mapping;
3012
mutex_enter(&dict_sys->mutex);
3014
mysql_num_index = table->getShare()->keys;
3015
ib_num_index = UT_LIST_GET_LEN(ib_table->indexes);
3017
index_mapping = share->idx_trans_tbl.index_mapping;
3019
/* If there exists inconsistency between MySQL and InnoDB dictionary
3020
(metadata) information, the number of index defined in MySQL
3021
could exceed that in InnoDB, do not build index translation
3022
table in such case */
3023
if (UNIV_UNLIKELY(ib_num_index < mysql_num_index)) {
3028
/* If index entry count is non-zero, nothing has
3029
changed since last update, directly return TRUE */
3030
if (share->idx_trans_tbl.index_count) {
3031
/* Index entry count should still match mysql_num_index */
3032
ut_a(share->idx_trans_tbl.index_count == mysql_num_index);
3036
/* The number of index increased, rebuild the mapping table */
3037
if (mysql_num_index > share->idx_trans_tbl.array_size) {
3038
index_mapping = (dict_index_t**) realloc(index_mapping,
3040
sizeof(*index_mapping));
3042
if (!index_mapping) {
3043
/* Report an error if index_mapping continues to be
3044
NULL and mysql_num_index is a non-zero value */
3045
errmsg_printf(error::ERROR, "InnoDB: fail to allocate memory for "
3046
"index translation table. Number of Index:%lu, array size:%lu",
3048
share->idx_trans_tbl.array_size);
3053
share->idx_trans_tbl.array_size = mysql_num_index;
3056
/* For each index in the mysql key_info array, fetch its
3057
corresponding InnoDB index pointer into index_mapping
3059
for (ulint count = 0; count < mysql_num_index; count++) {
3061
/* Fetch index pointers into index_mapping according to mysql
3063
index_mapping[count] = dict_table_get_index_on_name(
3064
ib_table, table->key_info[count].name);
3066
if (!index_mapping[count]) {
3067
errmsg_printf(error::ERROR, "Cannot find index %s in InnoDB index dictionary.",
3068
table->key_info[count].name);
3073
/* Double check fetched index has the same
3074
column info as those in mysql key_info. */
3075
if (!innobase_match_index_columns(&table->key_info[count], index_mapping[count])) {
3076
errmsg_printf(error::ERROR, "Found index %s whose column info does not match that of MySQL.",
3077
table->key_info[count].name);
3083
/* Successfully built the translation table */
3084
share->idx_trans_tbl.index_count = mysql_num_index;
3088
/* Build translation table failed. */
3089
free(index_mapping);
3091
share->idx_trans_tbl.array_size = 0;
3092
share->idx_trans_tbl.index_count = 0;
3093
index_mapping = NULL;
3096
share->idx_trans_tbl.index_mapping = index_mapping;
3098
mutex_exit(&dict_sys->mutex);
3103
/*******************************************************************//**
3104
This function uses index translation table to quickly locate the
3105
requested index structure.
3106
Note we do not have mutex protection for the index translatoin table
3107
access, it is based on the assumption that there is no concurrent
3108
translation table rebuild (fter create/drop index) and DMLs that
3109
require index lookup.
3110
@return dict_index_t structure for requested index. NULL if
3111
fail to locate the index structure. */
3114
innobase_index_lookup(
3115
/*==================*/
3116
INNOBASE_SHARE* share, /*!< in: share structure for index
3117
translation table. */
3118
uint keynr) /*!< in: index number for the requested
3121
if (!share->idx_trans_tbl.index_mapping
3122
|| keynr >= share->idx_trans_tbl.index_count) {
3126
return(share->idx_trans_tbl.index_mapping[keynr]);
2876
/*****************************************************************//**
2877
Normalizes a table name string. A normalized name consists of the
2878
database name catenated to '/' and table name. An example:
2879
test/mytable. On Windows normalization puts both the database name and the
2880
table name always to lower case. */
2883
normalize_table_name(
2884
/*=================*/
2885
char* norm_name, /*!< out: normalized name as a
2886
null-terminated string */
2887
const char* name) /*!< in: table name string */
2889
const char* name_ptr;
2893
/* Scan name from the end */
2895
ptr = strchr(name, '\0')-1;
2897
while (ptr >= name && *ptr != '\\' && *ptr != '/') {
2907
while (ptr >= name && *ptr != '\\' && *ptr != '/') {
2913
memcpy(norm_name, db_ptr, strlen(name) + 1 - (db_ptr - name));
2915
norm_name[name_ptr - db_ptr - 1] = '/';
2918
innobase_casedn_str(norm_name);
3129
2922
/********************************************************************//**
3130
2923
Set the autoinc column max value. This should only be called once from
3131
ha_innobase::open(). Therefore there's no need for a covering lock. */
2924
ha_innobase::open(). Therefore there's no need for a covering lock.
2925
@return DB_SUCCESS or error code */
3134
2928
ha_innobase::innobase_initialize_autoinc()
3135
2929
/*======================================*/
2931
dict_index_t* index;
3137
2932
uint64_t auto_inc;
3138
const Field* field = getTable()->found_next_number_field;
3140
if (field != NULL) {
3141
auto_inc = innobase_get_int_col_max_value(field);
3143
/* We have no idea what's been passed in to us as the
3144
autoinc column. We set it to the 0, effectively disabling
3145
updates to the table. */
2933
const char* col_name;
2936
col_name = table->found_next_number_field->field_name;
2937
index = innobase_get_index(table->getShare()->next_number_index);
2939
/* Execute SELECT MAX(col_name) FROM TABLE; */
2940
error = row_search_max_autoinc(index, col_name, &auto_inc);
2945
/* At the this stage we don't know the increment
2946
or the offset, so use default inrement of 1. */
2950
case DB_RECORD_NOT_FOUND:
3148
2951
ut_print_timestamp(stderr);
3149
errmsg_printf(error::ERROR, "InnoDB: Unable to determine the AUTOINC column name");
3152
if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) {
3153
/* If the recovery level is set so high that writes
3154
are disabled we force the AUTOINC counter to 0
3155
value effectively disabling writes to the table.
3156
Secondly, we avoid reading the table in case the read
3157
results in failure due to a corrupted table/index.
3159
We will not return an error to the client, so that the
3160
tables can be dumped with minimal hassle. If an error
3161
were returned in this case, the first attempt to read
3162
the table would fail and subsequent SELECTs would succeed. */
3164
} else if (field == NULL) {
3165
/* This is a far more serious error, best to avoid
3166
opening the table and return failure. */
3167
my_error(ER_AUTOINC_READ_FAILED, MYF(0));
3169
dict_index_t* index;
3170
const char* col_name;
3171
uint64_t read_auto_inc;
3174
update_session(getTable()->in_use);
3175
col_name = field->field_name;
3177
ut_a(prebuilt->trx == session_to_trx(user_session));
3179
index = innobase_get_index(getTable()->getShare()->next_number_index);
3181
/* Execute SELECT MAX(col_name) FROM TABLE; */
3182
err = row_search_max_autoinc(index, col_name, &read_auto_inc);
3186
uint64_t col_max_value;
3188
col_max_value = innobase_get_int_col_max_value(field);
3190
/* At the this stage we do not know the increment
3191
nor the offset, so use a default increment of 1. */
3193
auto_inc = innobase_next_autoinc(read_auto_inc, 1, 1, col_max_value);
3197
case DB_RECORD_NOT_FOUND:
3198
ut_print_timestamp(stderr);
3199
errmsg_printf(error::ERROR, "InnoDB: MySQL and InnoDB data dictionaries are out of sync.\n"
3200
"InnoDB: Unable to find the AUTOINC column %s in the InnoDB table %s.\n"
3201
"InnoDB: We set the next AUTOINC column value to 0,\n"
3202
"InnoDB: in effect disabling the AUTOINC next value generation.\n"
3203
"InnoDB: You can either set the next AUTOINC value explicitly using ALTER TABLE\n"
3204
"InnoDB: or fix the data dictionary by recreating the table.\n",
3205
col_name, index->table->name);
3207
/* This will disable the AUTOINC generation. */
3210
/* We want the open to succeed, so that the user can
3211
take corrective action. ie. reads should succeed but
3212
updates should fail. */
3216
/* row_search_max_autoinc() should only return
3217
one of DB_SUCCESS or DB_RECORD_NOT_FOUND. */
2952
fprintf(stderr, " InnoDB: MySQL and InnoDB data "
2953
"dictionaries are out of sync.\n"
2954
"InnoDB: Unable to find the AUTOINC column %s in the "
2955
"InnoDB table %s.\n"
2956
"InnoDB: We set the next AUTOINC column value to the "
2957
"maximum possible value,\n"
2958
"InnoDB: in effect disabling the AUTOINC next value "
2960
"InnoDB: You can either set the next AUTOINC value "
2961
"explicitly using ALTER TABLE\n"
2962
"InnoDB: or fix the data dictionary by recreating "
2964
col_name, index->table->name);
2966
auto_inc = 0xFFFFFFFFFFFFFFFFULL;
3222
2973
dict_table_autoinc_initialize(prebuilt->table, auto_inc);
3225
2978
/*****************************************************************//**
9103
8340
/************************************************************//**
8341
Validate the file format check value, is it one of "on" or "off",
8342
as a side effect it sets the srv_check_file_format_at_startup variable.
8343
@return true if config value one of "on" or "off" */
8346
innobase_file_format_check_on_off(
8347
/*==============================*/
8348
const char* format_check) /*!< in: parameter value */
8352
if (!innobase_strcasecmp(format_check, "off")) {
8354
/* Set the value to disable checking. */
8355
srv_check_file_format_at_startup = DICT_TF_FORMAT_MAX + 1;
8357
} else if (!innobase_strcasecmp(format_check, "on")) {
8359
/* Set the value to the lowest supported format. */
8360
srv_check_file_format_at_startup = DICT_TF_FORMAT_51;
8368
/************************************************************//**
9104
8369
Validate the file format check config parameters, as a side effect it
9105
sets the srv_max_file_format_at_startup variable.
9106
@return the format_id if valid config value, otherwise, return -1 */
8370
sets the srv_check_file_format_at_startup variable.
8371
@return true if valid config value */
9109
innobase_file_format_validate_and_set(
8374
innobase_file_format_check_validate(
9110
8375
/*================================*/
9111
const char* format_max) /*!< in: parameter value */
8376
const char* format_check) /*!< in: parameter value */
9113
8378
uint format_id;
9115
format_id = innobase_file_format_name_lookup(format_max);
8381
format_id = innobase_file_format_name_lookup(format_check);
9117
8383
if (format_id < DICT_TF_FORMAT_MAX + 1) {
9118
srv_max_file_format_at_startup = format_id;
9119
return((int) format_id);
8384
srv_check_file_format_at_startup = format_id;
8392
/*************************************************************//**
8393
Check if it is a valid file format. This function is registered as
8394
a callback with MySQL.
8395
@return 0 for valid file format */
8398
innodb_file_format_name_validate(
8399
/*=============================*/
8400
Session* , /*!< in: thread handle */
8401
drizzle_sys_var* , /*!< in: pointer to system
8403
void* save, /*!< out: immediate result
8404
for update function */
8405
drizzle_value* value) /*!< in: incoming string */
8407
const char* file_format_input;
8408
char buff[STRING_BUFFER_USUAL_SIZE];
8409
int len = sizeof(buff);
8412
ut_a(value != NULL);
8414
file_format_input = value->val_str(value, buff, &len);
8416
if (file_format_input != NULL) {
8419
format_id = innobase_file_format_name_lookup(
8422
if (format_id <= DICT_TF_FORMAT_MAX) {
8424
*static_cast<const char**>(save) = file_format_input;
8429
*static_cast<const char**>(save) = NULL;
8433
/****************************************************************//**
8434
Update the system variable innodb_file_format using the "saved"
8435
value. This function is registered as a callback with MySQL. */
8438
innodb_file_format_name_update(
8439
/*===========================*/
8440
Session* , /*!< in: thread handle */
8441
drizzle_sys_var* , /*!< in: pointer to
8443
void* var_ptr, /*!< out: where the
8444
formal string goes */
8445
const void* save) /*!< in: immediate result
8446
from check function */
8448
const char* format_name;
8450
ut_a(var_ptr != NULL);
8453
format_name = *static_cast<const char*const*>(save);
8458
format_id = innobase_file_format_name_lookup(format_name);
8460
if (format_id <= DICT_TF_FORMAT_MAX) {
8461
srv_file_format = format_id;
8465
*static_cast<const char**>(var_ptr)
8466
= trx_sys_file_format_id_to_name(srv_file_format);
8469
/*************************************************************//**
8470
Check if valid argument to innodb_file_format_check. This
8471
function is registered as a callback with MySQL.
8472
@return 0 for valid file format */
8475
innodb_file_format_check_validate(
8476
/*==============================*/
8477
Session* , /*!< in: thread handle */
8478
drizzle_sys_var* , /*!< in: pointer to system
8480
void* save, /*!< out: immediate result
8481
for update function */
8482
drizzle_value* value) /*!< in: incoming string */
8484
const char* file_format_input;
8485
char buff[STRING_BUFFER_USUAL_SIZE];
8486
int len = sizeof(buff);
8489
ut_a(value != NULL);
8491
file_format_input = value->val_str(value, buff, &len);
8493
if (file_format_input != NULL) {
8495
/* Check if user set on/off, we want to print a suitable
8496
message if they did so. */
8498
if (innobase_file_format_check_on_off(file_format_input)) {
8499
errmsg_printf(ERRMSG_LVL_WARN,
8500
"InnoDB: invalid innodb_file_format_check "
8501
"value; on/off can only be set at startup or "
8502
"in the configuration file");
8503
} else if (innobase_file_format_check_validate(
8504
file_format_input)) {
8506
*static_cast<const char**>(save) = file_format_input;
8511
errmsg_printf(ERRMSG_LVL_WARN,
8512
"InnoDB: invalid innodb_file_format_check "
8513
"value; can be any format up to %s "
8514
"or its equivalent numeric id",
8515
trx_sys_file_format_id_to_name(
8516
DICT_TF_FORMAT_MAX));
8520
*static_cast<const char**>(save) = NULL;
8524
/****************************************************************//**
8525
Update the system variable innodb_file_format_check using the "saved"
8526
value. This function is registered as a callback with MySQL. */
8529
innodb_file_format_check_update(
8530
/*============================*/
8531
Session* session, /*!< in: thread handle */
8532
drizzle_sys_var* , /*!< in: pointer to
8534
void* var_ptr, /*!< out: where the
8535
formal string goes */
8536
const void* save) /*!< in: immediate result
8537
from check function */
8539
const char* format_name_in;
8540
const char** format_name_out;
8544
ut_a(var_ptr != NULL);
8546
format_name_in = *static_cast<const char*const*>(save);
8548
if (!format_name_in) {
8553
format_id = innobase_file_format_name_lookup(format_name_in);
8555
if (format_id > DICT_TF_FORMAT_MAX) {
8556
/* DEFAULT is "on", which is invalid at runtime. */
8557
push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
8559
"Ignoring SET innodb_file_format=%s",
8564
format_name_out = static_cast<const char**>(var_ptr);
8566
/* Update the max format id in the system tablespace. */
8567
if (trx_sys_file_format_max_set(format_id, format_name_out)) {
8568
ut_print_timestamp(stderr);
8570
" [Info] InnoDB: the file format in the system "
8571
"tablespace is now set to %s.\n", *format_name_out);
8575
/****************************************************************//**
8576
Update the system variable innodb_adaptive_hash_index using the "saved"
8577
value. This function is registered as a callback with MySQL. */
8580
innodb_adaptive_hash_index_update(
8581
/*==============================*/
8582
Session* , /*!< in: thread handle */
8583
drizzle_sys_var* , /*!< in: pointer to
8585
void* , /*!< out: where the
8586
formal string goes */
8587
const void* save) /*!< in: immediate result
8588
from check function */
8590
if (*(bool*) save) {
8591
btr_search_enable();
8593
btr_search_disable();
8597
/*************************************************************//**
8598
Check if it is a valid value of innodb_change_buffering. This function is
8599
registered as a callback with MySQL.
8600
@return 0 for valid innodb_change_buffering */
8603
innodb_change_buffering_validate(
8604
/*=============================*/
8605
Session* , /*!< in: thread handle */
8606
drizzle_sys_var* , /*!< in: pointer to system
8608
void* save, /*!< out: immediate result
8609
for update function */
8610
drizzle_value* value) /*!< in: incoming string */
8612
const char* change_buffering_input;
8613
char buff[STRING_BUFFER_USUAL_SIZE];
8614
int len = sizeof(buff);
8617
ut_a(value != NULL);
8619
change_buffering_input = value->val_str(value, buff, &len);
8621
if (change_buffering_input != NULL) {
8624
for (use = 0; use < UT_ARR_SIZE(innobase_change_buffering_values);
8626
if (!innobase_strcasecmp(
8627
change_buffering_input,
8628
innobase_change_buffering_values[use])) {
8629
*(ibuf_use_t*) save = (ibuf_use_t) use;
8638
/****************************************************************//**
8639
Update the system variable innodb_change_buffering using the "saved"
8640
value. This function is registered as a callback with MySQL. */
8643
innodb_change_buffering_update(
8644
/*===========================*/
8645
Session* , /*!< in: thread handle */
8646
drizzle_sys_var* , /*!< in: pointer to
8648
void* var_ptr, /*!< out: where the
8649
formal string goes */
8650
const void* save) /*!< in: immediate result
8651
from check function */
8653
ut_a(var_ptr != NULL);
8655
ut_a((*(ibuf_use_t*) save) < IBUF_USE_COUNT);
8657
ibuf_use = *(const ibuf_use_t*) save;
8659
*(const char**) var_ptr = innobase_change_buffering_values[ibuf_use];
8662
/* plugin options */
8663
static DRIZZLE_SYSVAR_BOOL(checksums, innobase_use_checksums,
8664
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
8665
"Enable InnoDB checksums validation (enabled by default). ",
8668
static DRIZZLE_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
8669
PLUGIN_VAR_READONLY,
8670
"The common part for InnoDB table spaces.",
8673
static DRIZZLE_SYSVAR_BOOL(doublewrite, innobase_use_doublewrite,
8674
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
8675
"Enable InnoDB doublewrite buffer (enabled by default). ",
8678
static DRIZZLE_SYSVAR_ULONG(io_capacity, srv_io_capacity,
8679
PLUGIN_VAR_RQCMDARG,
8680
"Number of IOPs the server can do. Tunes the background IO rate",
8681
NULL, NULL, 200, 100, ~0L, 0);
8683
static DRIZZLE_SYSVAR_ULONG(fast_shutdown, innobase_fast_shutdown,
8684
PLUGIN_VAR_OPCMDARG,
8685
"Speeds up the shutdown process of the InnoDB storage engine. Possible "
8686
"values are 0, 1 (faster)"
8687
" or 2 (fastest - crash-like)"
8689
NULL, NULL, 1, 0, 2, 0);
8691
static DRIZZLE_SYSVAR_BOOL(file_per_table, srv_file_per_table,
8692
PLUGIN_VAR_NOCMDARG,
8693
"Stores each InnoDB table to an .ibd file in the database dir.",
8696
static DRIZZLE_SYSVAR_STR(file_format, innobase_file_format_name,
8697
PLUGIN_VAR_RQCMDARG,
8698
"File format to use for new tables in .ibd files.",
8699
innodb_file_format_name_validate,
8700
innodb_file_format_name_update, "Antelope");
8702
static DRIZZLE_SYSVAR_STR(file_format_check, innobase_file_format_check,
8703
PLUGIN_VAR_OPCMDARG,
8704
"The highest file format in the tablespace.",
8705
innodb_file_format_check_validate,
8706
innodb_file_format_check_update,
8709
static DRIZZLE_SYSVAR_ULONG(flush_log_at_trx_commit, srv_flush_log_at_trx_commit,
8710
PLUGIN_VAR_OPCMDARG,
8711
"Set to 0 (write and flush once per second),"
8712
" 1 (write and flush at each commit)"
8713
" or 2 (write at commit, flush once per second).",
8714
NULL, NULL, 1, 0, 2, 0);
8716
static DRIZZLE_SYSVAR_STR(flush_method, innobase_unix_file_flush_method,
8717
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
8718
"With which method to flush data.", NULL, NULL, NULL);
8720
#ifdef UNIV_LOG_ARCHIVE
8721
static DRIZZLE_SYSVAR_STR(log_arch_dir, innobase_log_arch_dir,
8722
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
8723
"Where full logs should be archived.", NULL, NULL, NULL);
8725
static DRIZZLE_SYSVAR_BOOL(log_archive, innobase_log_archive,
8726
PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
8727
"Set to 1 if you want to have logs archived.", NULL, NULL, FALSE);
8728
#endif /* UNIV_LOG_ARCHIVE */
8730
static DRIZZLE_SYSVAR_STR(log_group_home_dir, innobase_log_group_home_dir,
8731
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
8732
"Path to InnoDB log files.", NULL, NULL, NULL);
8734
static DRIZZLE_SYSVAR_ULONG(max_dirty_pages_pct, srv_max_buf_pool_modified_pct,
8735
PLUGIN_VAR_RQCMDARG,
8736
"Percentage of dirty pages allowed in bufferpool.",
8737
NULL, NULL, 75, 0, 99, 0);
8739
static DRIZZLE_SYSVAR_BOOL(adaptive_flushing, srv_adaptive_flushing,
8740
PLUGIN_VAR_NOCMDARG,
8741
"Attempt flushing dirty pages to avoid IO bursts at checkpoints.",
8744
static DRIZZLE_SYSVAR_ULONG(max_purge_lag, srv_max_purge_lag,
8745
PLUGIN_VAR_RQCMDARG,
8746
"Desired maximum length of the purge queue (0 = no limit)",
8747
NULL, NULL, 0, 0, ~0L, 0);
8749
static DRIZZLE_SYSVAR_BOOL(status_file, innobase_create_status_file,
8750
PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_NOSYSVAR,
8751
"Enable SHOW INNODB STATUS output in the innodb_status.<pid> file",
8754
static DRIZZLE_SYSVAR_BOOL(stats_on_metadata, innobase_stats_on_metadata,
8755
PLUGIN_VAR_OPCMDARG,
8756
"Enable statistics gathering for metadata commands such as SHOW TABLE STATUS (on by default)",
8759
static DRIZZLE_SYSVAR_ULONGLONG(stats_sample_pages, srv_stats_sample_pages,
8760
PLUGIN_VAR_RQCMDARG,
8761
"The number of index pages to sample when calculating statistics (default 8)",
8762
NULL, NULL, 8, 1, ~0ULL, 0);
8764
static DRIZZLE_SYSVAR_BOOL(adaptive_hash_index, btr_search_enabled,
8765
PLUGIN_VAR_OPCMDARG,
8766
"Enable InnoDB adaptive hash index (enabled by default).",
8767
NULL, innodb_adaptive_hash_index_update, TRUE);
8769
static DRIZZLE_SYSVAR_ULONG(replication_delay, srv_replication_delay,
8770
PLUGIN_VAR_RQCMDARG,
8771
"Replication thread delay (ms) on the slave server if "
8772
"innodb_thread_concurrency is reached (0 by default)",
8773
NULL, NULL, 0, 0, ~0UL, 0);
8775
static DRIZZLE_SYSVAR_LONG(additional_mem_pool_size, innobase_additional_mem_pool_size,
8776
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
8777
"Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.",
8778
NULL, NULL, 8*1024*1024L, 512*1024L, LONG_MAX, 1024);
8780
static DRIZZLE_SYSVAR_UINT(autoextend_increment, srv_auto_extend_increment,
8781
PLUGIN_VAR_RQCMDARG,
8782
"Data file autoextend increment in megabytes",
8783
NULL, NULL, 8L, 1L, 1000L, 0);
8785
static DRIZZLE_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,
8786
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
8787
"The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
8788
NULL, NULL, 128*1024*1024L, 5*1024*1024L, INT64_MAX, 1024*1024L);
8790
static DRIZZLE_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency,
8791
PLUGIN_VAR_RQCMDARG,
8792
"Helps in performance tuning in heavily concurrent environments.",
8793
innobase_commit_concurrency_validate, NULL, 0, 0, 1000, 0);
8795
static DRIZZLE_SYSVAR_ULONG(concurrency_tickets, srv_n_free_tickets_to_enter,
8796
PLUGIN_VAR_RQCMDARG,
8797
"Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket",
8798
NULL, NULL, 500L, 1L, ~0L, 0);
8800
static DRIZZLE_SYSVAR_LONG(file_io_threads, innobase_file_io_threads,
8801
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
8802
"Number of file I/O threads in InnoDB.",
8803
NULL, NULL, 4, 4, 64, 0);
8805
static DRIZZLE_SYSVAR_ULONG(read_io_threads, innobase_read_io_threads,
8806
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
8807
"Number of background read I/O threads in InnoDB.",
8808
NULL, NULL, 4, 1, 64, 0);
8810
static DRIZZLE_SYSVAR_ULONG(write_io_threads, innobase_write_io_threads,
8811
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
8812
"Number of background write I/O threads in InnoDB.",
8813
NULL, NULL, 4, 1, 64, 0);
8815
static DRIZZLE_SYSVAR_LONG(force_recovery, innobase_force_recovery,
8816
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
8817
"Helps to save your data in case the disk image of the database becomes corrupt.",
8818
NULL, NULL, 0, 0, 6, 0);
8820
static DRIZZLE_SYSVAR_LONG(log_buffer_size, innobase_log_buffer_size,
8821
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
8822
"The size of the buffer which InnoDB uses to write log to the log files on disk.",
8823
NULL, NULL, 8*1024*1024L, 256*1024L, LONG_MAX, 1024);
8825
static DRIZZLE_SYSVAR_LONGLONG(log_file_size, innobase_log_file_size,
8826
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
8827
"Size of each log file in a log group.",
8828
NULL, NULL, 20*1024*1024L, 1*1024*1024L, INT64_MAX, 1024*1024L);
8830
static DRIZZLE_SYSVAR_LONG(log_files_in_group, innobase_log_files_in_group,
8831
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
8832
"Number of log files in the log group. InnoDB writes to the files in a circular fashion. Value 3 is recommended here.",
8833
NULL, NULL, 2, 2, 100, 0);
8835
static DRIZZLE_SYSVAR_LONG(mirrored_log_groups, innobase_mirrored_log_groups,
8836
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
8837
"Number of identical copies of log groups we keep for the database. Currently this should be set to 1.",
8838
NULL, NULL, 1, 1, 10, 0);
8840
static DRIZZLE_SYSVAR_LONG(open_files, innobase_open_files,
8841
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
8842
"How many files at the maximum InnoDB keeps open at the same time.",
8843
NULL, NULL, 300L, 10L, LONG_MAX, 0);
8845
static DRIZZLE_SYSVAR_ULONG(sync_spin_loops, srv_n_spin_wait_rounds,
8846
PLUGIN_VAR_RQCMDARG,
8847
"Count of spin-loop rounds in InnoDB mutexes (30 by default)",
8848
NULL, NULL, 30L, 0L, ~0L, 0);
8850
static DRIZZLE_SYSVAR_ULONG(spin_wait_delay, srv_spin_wait_delay,
8851
PLUGIN_VAR_OPCMDARG,
8852
"Maximum delay between polling for a spin lock (6 by default)",
8853
NULL, NULL, 6L, 0L, ~0L, 0);
8855
static DRIZZLE_SYSVAR_ULONG(thread_concurrency, srv_thread_concurrency,
8856
PLUGIN_VAR_RQCMDARG,
8857
"Helps in performance tuning in heavily concurrent environments. Sets the maximum number of threads allowed inside InnoDB. Value 0 will disable the thread throttling.",
8858
NULL, NULL, 0, 0, 1000, 0);
8860
static DRIZZLE_SYSVAR_ULONG(thread_sleep_delay, srv_thread_sleep_delay,
8861
PLUGIN_VAR_RQCMDARG,
8862
"Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep",
8863
NULL, NULL, 10000L, 0L, ~0L, 0);
8865
static DRIZZLE_SYSVAR_STR(data_file_path, innobase_data_file_path,
8866
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
8867
"Path to individual files and their sizes.",
8870
static DRIZZLE_SYSVAR_STR(version, innodb_version_str,
8871
PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_READONLY,
8872
"InnoDB version", NULL, NULL, INNODB_VERSION_STR);
8874
static DRIZZLE_SYSVAR_BOOL(use_sys_malloc, srv_use_sys_malloc,
8875
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
8876
"Use OS memory allocator instead of InnoDB's internal memory allocator",
8879
static DRIZZLE_SYSVAR_STR(change_buffering, innobase_change_buffering,
8880
PLUGIN_VAR_RQCMDARG,
8881
"Buffer changes to reduce random access: "
8882
"OFF, ON, inserting, deleting, changing, or purging.",
8883
innodb_change_buffering_validate,
8884
innodb_change_buffering_update, NULL);
8886
static DRIZZLE_SYSVAR_ULONG(read_ahead_threshold, srv_read_ahead_threshold,
8887
PLUGIN_VAR_RQCMDARG,
8888
"Number of pages that must be accessed sequentially for InnoDB to"
8889
"trigger a readahead.",
8890
NULL, NULL, 56, 0, 64, 0);
9127
8892
static void init_options(drizzled::module::option_context &context)
9129
context("disable-checksums",
9130
"Disable InnoDB checksums validation.");
8894
context("checksums",
8895
po::value<bool>(&innobase_use_checksums)->default_value(true)->zero_tokens(),
8896
"Enable InnoDB checksums validation.");
9131
8897
context("data-home-dir",
9132
8898
po::value<string>(),
9133
8899
"The common part for InnoDB table spaces.");
9134
context("disable-doublewrite",
9135
"Disable InnoDB doublewrite buffer.");
8900
context("doublewrite",
8901
po::value<bool>(&innobase_use_doublewrite)->default_value(true)->zero_tokens(),
8902
"Enable InnoDB doublewrite buffer.");
9136
8903
context("io-capacity",
9137
po::value<io_capacity_constraint>(&innodb_io_capacity)->default_value(200),
8904
po::value<unsigned long>(&srv_io_capacity)->default_value(200),
9138
8905
"Number of IOPs the server can do. Tunes the background IO rate");
9139
8906
context("fast-shutdown",
9140
po::value<trinary_constraint>(&innobase_fast_shutdown)->default_value(1),
8907
po::value<unsigned long>(&innobase_fast_shutdown)->default_value(1),
9141
8908
"Speeds up the shutdown process of the InnoDB storage engine. Possible values are 0, 1 (faster) or 2 (fastest - crash-like).");
9142
context("purge-batch-size",
9143
po::value<purge_batch_constraint>(&innodb_purge_batch_size)->default_value(20),
9144
"Number of UNDO logs to purge in one batch from the history list. "
9146
context("purge-threads",
9147
po::value<purge_threads_constraint>(&innodb_n_purge_threads)->default_value(0),
9148
"Purge threads can be either 0 or 1. Defalut is 0.");
9149
8909
context("file-per-table",
9150
8910
po::value<bool>(&srv_file_per_table)->default_value(false)->zero_tokens(),
9151
"Stores each InnoDB table to an .ibd file in the database dir.");
9152
context("file-format-max",
9153
po::value<string>(&innobase_file_format_max)->default_value("Antelope"),
9154
"The highest file format in the tablespace.");
9155
context("file-format-check",
9156
po::value<bool>(&innobase_file_format_check)->default_value(true)->zero_tokens(),
9157
"Whether to perform system file format check.");
8911
"Stores each InnoDB table to an .ibd file in the database dir.");
9158
8912
context("file-format",
9159
po::value<string>(&innobase_file_format_name)->default_value("Antelope"),
8913
po::value<string>()->default_value("Antelope"),
9160
8914
"File format to use for new tables in .ibd files.");
8915
context("file-format-check",
8916
po::value<string>()->default_value("on"),
8917
"The highest file format in the tablespace.");
9161
8918
context("flush-log-at-trx-commit",
9162
po::value<trinary_constraint>(&innodb_flush_log_at_trx_commit)->default_value(1),
8919
po::value<unsigned long>(&srv_flush_log_at_trx_commit)->default_value(1),
9163
8920
"Set to 0 (write and flush once per second), 1 (write and flush at each commit) or 2 (write at commit, flush once per second).");
9164
8921
context("flush-method",
9165
8922
po::value<string>(),
9166
8923
"With which method to flush data.");
8924
#ifdef UNIV_LOG_ARCHIVE
8925
context("log-arch-dir",
8926
po::value<string>(),
8927
"Where full logs should be archived.");
8928
context("log-archive",
8929
po::value<bool>(&innobase_log_archive)->default_value(false)->zero_tokens(),
8930
"Set to 1 if you want to have logs archived.");
8931
#endif /* UNIV_LOG_ARCHIVE */
9167
8932
context("log-group-home-dir",
9168
8933
po::value<string>(),
9169
8934
"Path to InnoDB log files.");
9170
8935
context("max-dirty-pages-pct",
9171
po::value<max_dirty_pages_constraint>(&innodb_max_dirty_pages_pct)->default_value(75),
8936
po::value<unsigned long>(&srv_max_buf_pool_modified_pct)->default_value(75),
9172
8937
"Percentage of dirty pages allowed in bufferpool.");
9173
context("disable-adaptive-flushing",
9174
"Do not attempt flushing dirty pages to avoid IO bursts at checkpoints.");
8938
context("adaptive-flushing",
8939
po::value<bool>(&srv_adaptive_flushing)->default_value(true)->zero_tokens(),
8940
"Attempt flushing dirty pages to avoid IO bursts at checkpoints.");
9175
8941
context("max-purge-lag",
9176
po::value<uint64_constraint>(&innodb_max_purge_lag)->default_value(0),
8942
po::value<unsigned long>(&srv_max_purge_lag)->default_value(0),
9177
8943
"Desired maximum length of the purge queue (0 = no limit)");
9178
8944
context("status-file",
9179
8945
po::value<bool>(&innobase_create_status_file)->default_value(false)->zero_tokens(),
9180
8946
"Enable SHOW INNODB STATUS output in the innodb_status.<pid> file");
9181
context("disable-stats-on-metadata",
9182
"Disable statistics gathering for metadata commands such as SHOW TABLE STATUS (on by default)");
8947
context("stats-on-metadata",
8948
po::value<bool>(&innobase_stats_on_metadata)->default_value(true)->zero_tokens(),
8949
"Enable statistics gathering for metadata commands such as SHOW TABLE STATUS (on by default)");
9183
8950
context("stats-sample-pages",
9184
po::value<uint64_nonzero_constraint>(&innodb_stats_sample_pages)->default_value(8),
8951
po::value<uint64_t>(&srv_stats_sample_pages)->default_value(8),
9185
8952
"The number of index pages to sample when calculating statistics (default 8)");
9186
context("disable-adaptive-hash-index",
8953
context("adaptive-hash-index",
8954
po::value<bool>(&btr_search_enabled)->default_value(true)->zero_tokens(),
9187
8955
"Enable InnoDB adaptive hash index (enabled by default)");
9188
8956
context("replication-delay",
9189
po::value<uint64_constraint>(&innodb_replication_delay)->default_value(0),
8957
po::value<unsigned long>(&srv_replication_delay)->default_value(0),
9190
8958
"Replication thread delay (ms) on the slave server if innodb_thread_concurrency is reached (0 by default)");
9191
8959
context("additional-mem-pool-size",
9192
po::value<additional_mem_pool_constraint>(&innobase_additional_mem_pool_size)->default_value(8*1024*1024L),
8960
po::value<long>(&innobase_additional_mem_pool_size)->default_value(8*1024*1024L),
9193
8961
"Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.");
9194
8962
context("autoextend-increment",
9195
po::value<autoextend_constraint>(&innodb_auto_extend_increment)->default_value(64L),
8963
po::value<uint32_t>(&srv_auto_extend_increment)->default_value(8L),
9196
8964
"Data file autoextend increment in megabytes");
9197
8965
context("buffer-pool-size",
9198
po::value<buffer_pool_constraint>(&innobase_buffer_pool_size)->default_value(128*1024*1024L),
8966
po::value<int64_t>(&innobase_buffer_pool_size)->default_value(128*1024*1024L),
9199
8967
"The size of the memory buffer InnoDB uses to cache data and indexes of its tables.");
9200
context("buffer-pool-instances",
9201
po::value<buffer_pool_instances_constraint>(&innobase_buffer_pool_instances)->default_value(1),
9202
"Number of buffer pool instances, set to higher value on high-end machines to increase scalability");
9204
8968
context("commit-concurrency",
9205
po::value<concurrency_constraint>(&innobase_commit_concurrency)->default_value(0),
8969
po::value<unsigned long>(&innobase_commit_concurrency)->default_value(0),
9206
8970
"Helps in performance tuning in heavily concurrent environments.");
9207
8971
context("concurrency-tickets",
9208
po::value<uint32_nonzero_constraint>(&innodb_concurrency_tickets)->default_value(500L),
8972
po::value<unsigned long>(&srv_n_free_tickets_to_enter)->default_value(500L),
9209
8973
"Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket");
8974
context("file-io-threads",
8975
po::value<long>(&innobase_file_io_threads)->default_value(4),
8976
"Number of file I/O threads in InnoDB.");
9210
8977
context("read-io-threads",
9211
po::value<io_threads_constraint>(&innobase_read_io_threads)->default_value(4),
8978
po::value<unsigned long>(&innobase_read_io_threads)->default_value(4),
9212
8979
"Number of background read I/O threads in InnoDB.");
9213
8980
context("write-io-threads",
9214
po::value<io_threads_constraint>(&innobase_write_io_threads)->default_value(4),
8981
po::value<unsigned long>(&innobase_write_io_threads)->default_value(4),
9215
8982
"Number of background write I/O threads in InnoDB.");
9216
8983
context("force-recovery",
9217
po::value<force_recovery_constraint>(&innobase_force_recovery)->default_value(0),
8984
po::value<long>(&innobase_force_recovery)->default_value(0),
9218
8985
"Helps to save your data in case the disk image of the database becomes corrupt.");
9219
8986
context("log-buffer-size",
9220
po::value<log_buffer_constraint>(&innobase_log_buffer_size)->default_value(8*1024*1024L),
8987
po::value<long>(&innobase_log_buffer_size)->default_value(8*1024*1024L),
9221
8988
"The size of the buffer which InnoDB uses to write log to the log files on disk.");
9222
8989
context("log-file-size",
9223
po::value<log_file_constraint>(&innobase_log_file_size)->default_value(20*1024*1024L),
8990
po::value<int64_t>(&innobase_log_file_size)->default_value(20*1024*1024L),
9224
8991
"The size of the buffer which InnoDB uses to write log to the log files on disk.");
9225
8992
context("log-files-in-group",
9226
po::value<log_files_in_group_constraint>(&innobase_log_files_in_group)->default_value(2),
8993
po::value<long>(&innobase_log_files_in_group)->default_value(2),
9227
8994
"Number of log files in the log group. InnoDB writes to the files in a circular fashion.");
9228
8995
context("mirrored-log-groups",
9229
po::value<mirrored_log_groups_constraint>(&innobase_mirrored_log_groups)->default_value(1),
8996
po::value<long>(&innobase_mirrored_log_groups)->default_value(1),
9230
8997
"Number of identical copies of log groups we keep for the database. Currently this should be set to 1.");
9231
8998
context("open-files",
9232
po::value<open_files_constraint>(&innobase_open_files)->default_value(300L),
8999
po::value<long>(&innobase_open_files)->default_value(300L),
9233
9000
"How many files at the maximum InnoDB keeps open at the same time.");
9234
9001
context("sync-spin-loops",
9235
po::value<uint32_constraint>(&innodb_sync_spin_loops)->default_value(30L),
9002
po::value<unsigned long>(&srv_n_spin_wait_rounds)->default_value(30L),
9236
9003
"Count of spin-loop rounds in InnoDB mutexes (30 by default)");
9237
9004
context("spin-wait-delay",
9238
po::value<uint32_constraint>(&innodb_spin_wait_delay)->default_value(6L),
9005
po::value<unsigned long>(&srv_spin_wait_delay)->default_value(6L),
9239
9006
"Maximum delay between polling for a spin lock (6 by default)");
9240
9007
context("thread-concurrency",
9241
po::value<concurrency_constraint>(&innobase_thread_concurrency)->default_value(0),
9008
po::value<unsigned long>(&srv_thread_concurrency)->default_value(0),
9242
9009
"Helps in performance tuning in heavily concurrent environments. Sets the maximum number of threads allowed inside InnoDB. Value 0 will disable the thread throttling.");
9243
9010
context("thread-sleep-delay",
9244
po::value<uint32_constraint>(&innodb_thread_sleep_delay)->default_value(10000L),
9011
po::value<unsigned long>(&srv_thread_sleep_delay)->default_value(10000L),
9245
9012
"Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep");
9246
9013
context("data-file-path",
9247
9014
po::value<string>(),