@@ -17166,11 +17166,13 @@ innodb_adaptive_hash_index_update(
17166
17166
const void* save) /*!< in: immediate result
17167
17167
from check function */
17168
17168
{
17169
+ mysql_mutex_unlock(&LOCK_global_system_variables);
17169
17170
if (*(my_bool*) save) {
17170
17171
btr_search_enable();
17171
17172
} else {
17172
17173
btr_search_disable();
17173
17174
}
17175
+ mysql_mutex_lock(&LOCK_global_system_variables);
17174
17176
}
17175
17177
17176
17178
/****************************************************************//**
@@ -17191,7 +17193,9 @@ innodb_cmp_per_index_update(
17191
17193
/* Reset the stats whenever we enable the table
17192
17194
INFORMATION_SCHEMA.innodb_cmp_per_index. */
17193
17195
if (!srv_cmp_per_index_enabled && *(my_bool*) save) {
17196
+ mysql_mutex_unlock(&LOCK_global_system_variables);
17194
17197
page_zip_reset_stat_per_index();
17198
+ mysql_mutex_lock(&LOCK_global_system_variables);
17195
17199
}
17196
17200
17197
17201
srv_cmp_per_index_enabled = !!(*(my_bool*) save);
@@ -17212,9 +17216,11 @@ innodb_old_blocks_pct_update(
17212
17216
const void* save) /*!< in: immediate result
17213
17217
from check function */
17214
17218
{
17215
- innobase_old_blocks_pct = static_cast<uint>(
17216
- buf_LRU_old_ratio_update(
17217
- *static_cast<const uint*>(save), TRUE));
17219
+ mysql_mutex_unlock(&LOCK_global_system_variables);
17220
+ uint ratio = buf_LRU_old_ratio_update(*static_cast<const uint*>(save),
17221
+ true);
17222
+ mysql_mutex_lock(&LOCK_global_system_variables);
17223
+ innobase_old_blocks_pct = ratio;
17218
17224
}
17219
17225
17220
17226
/****************************************************************//**
@@ -17232,9 +17238,10 @@ innodb_change_buffer_max_size_update(
17232
17238
const void* save) /*!< in: immediate result
17233
17239
from check function */
17234
17240
{
17235
- innobase_change_buffer_max_size =
17236
- (*static_cast<const uint*>(save) );
17241
+ innobase_change_buffer_max_size = *static_cast<const uint*>(save);
17242
+ mysql_mutex_unlock(&LOCK_global_system_variables );
17237
17243
ibuf_max_size_update(innobase_change_buffer_max_size);
17244
+ mysql_mutex_lock(&LOCK_global_system_variables);
17238
17245
}
17239
17246
17240
17247
#ifdef UNIV_DEBUG
@@ -17278,6 +17285,7 @@ innodb_make_page_dirty(
17278
17285
{
17279
17286
mtr_t mtr;
17280
17287
ulong space_id = *static_cast<const ulong*>(save);
17288
+ mysql_mutex_unlock(&LOCK_global_system_variables);
17281
17289
17282
17290
mtr_start(&mtr);
17283
17291
@@ -17295,6 +17303,7 @@ innodb_make_page_dirty(
17295
17303
MLOG_2BYTES, &mtr);
17296
17304
}
17297
17305
mtr_commit(&mtr);
17306
+ mysql_mutex_lock(&LOCK_global_system_variables);
17298
17307
}
17299
17308
#endif // UNIV_DEBUG
17300
17309
@@ -17933,8 +17942,11 @@ innodb_buffer_pool_evict_update(
17933
17942
{
17934
17943
if (const char* op = *static_cast<const char*const*>(save)) {
17935
17944
if (!strcmp(op, "uncompressed")) {
17945
+ mysql_mutex_unlock(&LOCK_global_system_variables);
17936
17946
for (uint tries = 0; tries < 10000; tries++) {
17937
17947
if (innodb_buffer_pool_evict_uncompressed()) {
17948
+ mysql_mutex_lock(
17949
+ &LOCK_global_system_variables);
17938
17950
return;
17939
17951
}
17940
17952
@@ -18237,7 +18249,9 @@ purge_run_now_set(
18237
18249
check function */
18238
18250
{
18239
18251
if (*(my_bool*) save && trx_purge_state() != PURGE_STATE_DISABLED) {
18252
+ mysql_mutex_unlock(&LOCK_global_system_variables);
18240
18253
trx_purge_run();
18254
+ mysql_mutex_lock(&LOCK_global_system_variables);
18241
18255
}
18242
18256
}
18243
18257
@@ -18260,7 +18274,9 @@ purge_stop_now_set(
18260
18274
check function */
18261
18275
{
18262
18276
if (*(my_bool*) save && trx_purge_state() != PURGE_STATE_DISABLED) {
18277
+ mysql_mutex_unlock(&LOCK_global_system_variables);
18263
18278
trx_purge_stop();
18279
+ mysql_mutex_lock(&LOCK_global_system_variables);
18264
18280
}
18265
18281
}
18266
18282
@@ -18282,6 +18298,8 @@ checkpoint_now_set(
18282
18298
check function */
18283
18299
{
18284
18300
if (*(my_bool*) save) {
18301
+ mysql_mutex_unlock(&LOCK_global_system_variables);
18302
+
18285
18303
while (log_sys->last_checkpoint_lsn < log_sys->lsn) {
18286
18304
log_make_checkpoint_at(LSN_MAX, TRUE);
18287
18305
fil_flush_file_spaces(FIL_LOG);
@@ -18295,6 +18313,8 @@ checkpoint_now_set(
18295
18313
"system tablespace at checkpoint err=%s",
18296
18314
ut_strerr(err));
18297
18315
}
18316
+
18317
+ mysql_mutex_lock(&LOCK_global_system_variables);
18298
18318
}
18299
18319
}
18300
18320
@@ -18316,8 +18336,10 @@ buf_flush_list_now_set(
18316
18336
check function */
18317
18337
{
18318
18338
if (*(my_bool*) save) {
18339
+ mysql_mutex_unlock(&LOCK_global_system_variables);
18319
18340
buf_flush_list(ULINT_MAX, LSN_MAX, NULL);
18320
18341
buf_flush_wait_batch_end(NULL, BUF_FLUSH_LIST);
18342
+ mysql_mutex_lock(&LOCK_global_system_variables);
18321
18343
}
18322
18344
}
18323
18345
#endif /* UNIV_DEBUG */
@@ -18419,7 +18441,9 @@ buffer_pool_dump_now(
18419
18441
check function */
18420
18442
{
18421
18443
if (*(my_bool*) save && !srv_read_only_mode) {
18444
+ mysql_mutex_unlock(&LOCK_global_system_variables);
18422
18445
buf_dump_start();
18446
+ mysql_mutex_lock(&LOCK_global_system_variables);
18423
18447
}
18424
18448
}
18425
18449
@@ -18442,7 +18466,9 @@ buffer_pool_load_now(
18442
18466
check function */
18443
18467
{
18444
18468
if (*(my_bool*) save && !srv_read_only_mode) {
18469
+ mysql_mutex_unlock(&LOCK_global_system_variables);
18445
18470
buf_load_start();
18471
+ mysql_mutex_lock(&LOCK_global_system_variables);
18446
18472
}
18447
18473
}
18448
18474
@@ -18465,96 +18491,71 @@ buffer_pool_load_abort(
18465
18491
check function */
18466
18492
{
18467
18493
if (*(my_bool*) save && !srv_read_only_mode) {
18494
+ mysql_mutex_unlock(&LOCK_global_system_variables);
18468
18495
buf_load_abort();
18496
+ mysql_mutex_lock(&LOCK_global_system_variables);
18469
18497
}
18470
18498
}
18471
18499
18472
18500
/** Update innodb_status_output or innodb_status_output_locks,
18473
18501
which control InnoDB "status monitor" output to the error log.
18474
- @param[in] thd thread handle
18475
- @param[in] var system variable
18476
- @param[out] var_ptr current value
18502
+ @param[out] var current value
18477
18503
@param[in] save to-be-assigned value */
18478
18504
static
18479
18505
void
18480
- innodb_status_output_update(
18481
- /*========================*/
18482
- THD* thd __attribute__((unused)),
18483
- struct st_mysql_sys_var* var __attribute__((unused)),
18484
- void* var_ptr __attribute__((unused)),
18485
- const void* save __attribute__((unused)))
18506
+ innodb_status_output_update(THD*,st_mysql_sys_var*,void*var,const void*save)
18486
18507
{
18487
- *static_cast<my_bool*>(var_ptr) = *static_cast<const my_bool*>(save);
18508
+ *static_cast<my_bool*>(var) = *static_cast<const my_bool*>(save);
18509
+ mysql_mutex_unlock(&LOCK_global_system_variables);
18488
18510
/* Wakeup server monitor thread. */
18489
18511
os_event_set(srv_monitor_event);
18512
+ mysql_mutex_lock(&LOCK_global_system_variables);
18490
18513
}
18491
18514
18492
- /******************************************************************
18493
- Update the system variable innodb_encryption_threads */
18515
+ /** Update the system variable innodb_encryption_threads.
18516
+ @param[in] save to-be-assigned value */
18494
18517
static
18495
18518
void
18496
- innodb_encryption_threads_update(
18497
- /*=============================*/
18498
- THD* thd, /*!< in: thread handle */
18499
- struct st_mysql_sys_var* var, /*!< in: pointer to
18500
- system variable */
18501
- void* var_ptr,/*!< out: where the
18502
- formal string goes */
18503
- const void* save) /*!< in: immediate result
18504
- from check function */
18519
+ innodb_encryption_threads_update(THD*,st_mysql_sys_var*,void*,const void*save)
18505
18520
{
18521
+ mysql_mutex_unlock(&LOCK_global_system_variables);
18506
18522
fil_crypt_set_thread_cnt(*static_cast<const uint*>(save));
18523
+ mysql_mutex_lock(&LOCK_global_system_variables);
18507
18524
}
18508
18525
18509
- /******************************************************************
18510
- Update the system variable innodb_encryption_rotate_key_age */
18526
+ /** Update the system variable innodb_encryption_rotate_key_age.
18527
+ @param[in] save to-be-assigned value */
18511
18528
static
18512
18529
void
18513
- innodb_encryption_rotate_key_age_update(
18514
- /*====================================*/
18515
- THD* thd, /*!< in: thread handle */
18516
- struct st_mysql_sys_var* var, /*!< in: pointer to
18517
- system variable */
18518
- void* var_ptr,/*!< out: where the
18519
- formal string goes */
18520
- const void* save) /*!< in: immediate result
18521
- from check function */
18530
+ innodb_encryption_rotate_key_age_update(THD*,st_mysql_sys_var*,void*,
18531
+ const void*save)
18522
18532
{
18533
+ mysql_mutex_unlock(&LOCK_global_system_variables);
18523
18534
fil_crypt_set_rotate_key_age(*static_cast<const uint*>(save));
18535
+ mysql_mutex_lock(&LOCK_global_system_variables);
18524
18536
}
18525
18537
18526
- /******************************************************************
18527
- Update the system variable innodb_encryption_rotation_iops */
18538
+ /** Update the system variable innodb_encryption_rotation_iops.
18539
+ @param[in] save to-be-assigned value */
18528
18540
static
18529
18541
void
18530
- innodb_encryption_rotation_iops_update(
18531
- /*===================================*/
18532
- THD* thd, /*!< in: thread handle */
18533
- struct st_mysql_sys_var* var, /*!< in: pointer to
18534
- system variable */
18535
- void* var_ptr,/*!< out: where the
18536
- formal string goes */
18537
- const void* save) /*!< in: immediate result
18538
- from check function */
18542
+ innodb_encryption_rotation_iops_update(THD*,st_mysql_sys_var*,void*,
18543
+ const void*save)
18539
18544
{
18545
+ mysql_mutex_unlock(&LOCK_global_system_variables);
18540
18546
fil_crypt_set_rotation_iops(*static_cast<const uint*>(save));
18547
+ mysql_mutex_lock(&LOCK_global_system_variables);
18541
18548
}
18542
18549
18543
- /******************************************************************
18544
- Update the system variable innodb_encrypt_tables */
18550
+ /** Update the system variable innodb_encrypt_tables.
18551
+ @param[in] save to-be-assigned value */
18545
18552
static
18546
18553
void
18547
- innodb_encrypt_tables_update(
18548
- /*=========================*/
18549
- THD* thd, /*!< in: thread handle */
18550
- struct st_mysql_sys_var* var, /*!< in: pointer to
18551
- system variable */
18552
- void* var_ptr,/*!< out: where the
18553
- formal string goes */
18554
- const void* save) /*!< in: immediate result
18555
- from check function */
18554
+ innodb_encrypt_tables_update(THD*,st_mysql_sys_var*,void*,const void*save)
18556
18555
{
18556
+ mysql_mutex_unlock(&LOCK_global_system_variables);
18557
18557
fil_crypt_set_encrypt_tables(*static_cast<const ulong*>(save));
18558
+ mysql_mutex_lock(&LOCK_global_system_variables);
18558
18559
}
18559
18560
18560
18561
static SHOW_VAR innodb_status_variables_export[]= {
@@ -19736,12 +19737,15 @@ innobase_disallow_writes_update(
19736
19737
variable */
19737
19738
const void* save) /* in: temporary storage */
19738
19739
{
19739
- *(my_bool*)var_ptr = *(my_bool*)save;
19740
+ const my_bool val = *static_cast<const my_bool*>(save);
19741
+ *static_cast<my_bool*>(var_ptr) = val;
19740
19742
ut_a(srv_allow_writes_event);
19741
- if (*(my_bool*)var_ptr)
19743
+ mysql_mutex_unlock(&LOCK_global_system_variables);
19744
+ if (val)
19742
19745
os_event_reset(srv_allow_writes_event);
19743
19746
else
19744
19747
os_event_set(srv_allow_writes_event);
19748
+ mysql_mutex_lock(&LOCK_global_system_variables);
19745
19749
}
19746
19750
19747
19751
static MYSQL_SYSVAR_BOOL(disallow_writes, innobase_disallow_writes,
0 commit comments