241
241
static sys_var_long_ptr sys_delayed_queue_size(&vars, "delayed_queue_size",
242
242
&delayed_queue_size);
244
#ifdef HAVE_EVENT_SCHEDULER
244
245
static sys_var_event_scheduler sys_event_scheduler(&vars, "event_scheduler");
245
248
static sys_var_long_ptr sys_expire_logs_days(&vars, "expire_logs_days",
246
249
&expire_logs_days);
247
250
static sys_var_bool_ptr sys_flush(&vars, "flush", &myisam_flush);
275
278
param_age_threshold));
276
279
static sys_var_bool_ptr sys_local_infile(&vars, "local_infile",
277
280
&opt_local_infile);
278
static sys_var_bool_ptr
281
static sys_var_bool_ptr
279
282
sys_trust_function_creators(&vars, "log_bin_trust_function_creators",
280
283
&trust_function_creators);
281
284
static sys_var_bool_ptr
426
429
static sys_var_thd_ulong sys_trans_prealloc_size(&vars, "transaction_prealloc_size",
427
430
&SV::trans_prealloc_size,
428
431
0, fix_trans_mem_root);
429
sys_var_enum_const sys_thread_handling(&vars, "thread_handling",
430
&SV::thread_handling,
431
&thread_handling_typelib,
432
sys_var_enum_const sys_thread_handling(&vars, "thread_handling",
433
&SV::thread_handling,
434
&thread_handling_typelib,
434
437
#ifdef HAVE_QUERY_CACHE
435
438
static sys_var_long_ptr sys_query_cache_limit(&vars, "query_cache_limit",
504
507
&table_cache_size);
505
508
static sys_var_long_ptr sys_table_lock_wait_timeout(&vars, "table_lock_wait_timeout",
506
509
&table_lock_wait_timeout);
511
#if defined(ENABLED_DEBUG_SYNC)
512
/* Debug Sync Facility. Implemented in debug_sync.cc. */
513
static sys_var_debug_sync sys_debug_sync(&vars, "debug_sync");
514
#endif /* defined(ENABLED_DEBUG_SYNC) */
507
516
static sys_var_long_ptr sys_thread_cache_size(&vars, "thread_cache_size",
508
517
&thread_cache_size);
509
518
#if HAVE_POOL_OF_THREADS == 1
725
734
return (uchar*) &thd->sys_var_tmp.long_value;
728
static sys_var_readonly sys_repl_report_port(&vars, "report_port", OPT_GLOBAL, SHOW_INT, slave_get_report_port);
737
static sys_var_readonly sys_repl_report_port(&vars, "report_port", OPT_GLOBAL, SHOW_LONG, slave_get_report_port);
822
831
#ifdef HAVE_THR_SETCONCURRENCY
823
832
{"thread_concurrency", (char*) &concurrency, SHOW_LONG},
825
{"thread_stack", (char*) &thread_stack, SHOW_LONG},
834
{"thread_stack", (char*) &my_thread_stack_size, SHOW_LONG},
1511
1520
if (var->type == OPT_GLOBAL)
1513
1522
/* Lock is needed to make things safe on 32 bit systems */
1514
pthread_mutex_lock(&LOCK_global_system_variables);
1523
pthread_mutex_lock(&LOCK_global_system_variables);
1515
1524
global_system_variables.*offset= (ha_rows) tmp;
1516
1525
pthread_mutex_unlock(&LOCK_global_system_variables);
1693
1710
ulonglong tmp= var->value->val_int();
1695
For when the enum is made to contain 64 elements, as 1ULL<<64 is
1696
undefined, we guard with a "count<64" test.
1712
if (!m_allow_empty_value &&
1721
For when the enum is made to contain 64 elements, as 1ULL<<64 is
1722
undefined, we guard with a "count<64" test.
1698
1724
if (unlikely((tmp >= ((ULL(1)) << enum_names->count)) &&
1699
1725
(enum_names->count < 64)))
2209
2235
if (!cache_name || ! cache_name->length)
2210
2236
cache_name= &default_key_cache_base;
2211
2237
return ((KEY_CACHE*) find_named(&key_caches,
2212
cache_name->str, cache_name->length, 0));
2238
cache_name->str, cache_name->length, 0));
2216
2241
uchar *sys_var_key_cache_param::value_ptr(THD *thd, enum_var_type type,
2217
2242
LEX_STRING *base)
2394
2419
MY_STAT f_stat;
2395
2420
String str(buff, sizeof(buff), system_charset_info), *res;
2396
2421
const char *log_file_str;
2398
2424
if (!(res= var->value->val_str(&str)))
2401
2427
log_file_str= res->c_ptr();
2402
2428
bzero(&f_stat, sizeof(MY_STAT));
2404
(void) unpack_filename(path, log_file_str);
2430
path_length= unpack_filename(path, log_file_str);
2434
/* File name is empty. */
2405
2439
if (my_stat(path, &f_stat, MYF(0)))
2407
/* Check if argument is a file and we have 'write' permission */
2442
A file system object exists. Check if argument is a file and we have
2408
2446
if (!MY_S_ISREG(f_stat.st_mode) ||
2409
2447
!(f_stat.st_mode & MY_S_IWRITE))
2416
Check if directory exists and
2417
we have permission to create file & write to file
2419
(void) dirname_part(path, log_file_str, &path_length);
2420
if (my_access(path, (F_OK|W_OK)))
2453
/* Get dirname of the file path. */
2454
(void) dirname_part(path, log_file_str, &path_length);
2456
/* Dirname is empty if file path is relative. */
2461
Check if directory exists and we have permission to create file and
2464
if (my_access(path, (F_OK|W_OK)))
2934
2978
ulonglong org_options= thd->options;
2981
If we are setting AUTOCOMMIT=1 and it was not already 1, then we
2982
need to commit any outstanding transactions.
2984
if (var->save_result.ulong_value != 0 &&
2985
(thd->options & OPTION_NOT_AUTOCOMMIT) &&
2936
2989
if (var->save_result.ulong_value != 0)
2937
2990
thd->options&= ~((sys_var_thd_bit*) var->var)->bit_flag;
3625
3676
if (type == OPT_GLOBAL)
3626
3677
plugin= my_plugin_lock(thd, &(global_system_variables.*offset));
3627
3678
hton= plugin_data(plugin, handlerton*);
3628
engine_name= &hton2plugin[hton->slot]->name;
3679
engine_name= hton_name(hton);
3629
3680
result= (uchar *) thd->strmake(engine_name->str, engine_name->length);
3630
3681
if (type == OPT_GLOBAL)
3631
3682
plugin_unlock(thd, plugin);
3968
4019
DBUG_ENTER("sys_var_opt_readonly::update");
3970
4021
/* Prevent self dead-lock */
3971
if (thd->locked_tables || thd->active_transaction())
4022
if (thd->locked_tables_mode || thd->active_transaction())
3973
4024
my_error(ER_LOCK_OR_ACTIVE_TRANSACTION, MYF(0));
3974
4025
DBUG_RETURN(true);
4009
4060
can cause to wait on a read lock, it's required for the client application
4010
4061
to unlock everything, and acceptable for the server to wait on all locks.
4012
if (result= close_cached_tables(thd, NULL, FALSE, TRUE, TRUE))
4063
if (result= close_cached_tables(thd, NULL, FALSE, TRUE))
4013
4064
goto end_with_read_lock;
4015
4066
if (result= make_global_read_lock_block_commit(thd))
4052
4103
return (uchar*) thd->strdup(buf);
4106
#ifdef HAVE_EVENT_SCHEDULER
4056
4107
bool sys_var_event_scheduler::check(THD *thd, set_var *var)
4058
4109
return check_enum(thd, var, &Events::var_typelib);
4063
4113
The update method of the global variable event_scheduler.
4064
4114
If event_scheduler is switched from 0 to 1 then the scheduler main