summaryrefslogtreecommitdiff
path: root/storage/innobase/buf
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-04-28 14:51:25 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-04-28 16:09:07 +0300
commit704180747658019aa52173e44e99229b8ae56efa (patch)
tree99d3256ba9302fccc89217a404328750a766e43b /storage/innobase/buf
parentcce1b6e245a7ee30e6ebfcd45556e8caa6e754c2 (diff)
downloadmariadb-git-704180747658019aa52173e44e99229b8ae56efa.tar.gz
MDEV-22393 Corruption for SET GLOBAL innodb_ string variables
Several MYSQL_SYSVAR_STR parameters that employ both a validate function callback fail to copy the string for saving the validated value. The affected variables include the following: innodb_ft_aux_table innodb_ft_server_stopword_table innodb_ft_user_stopword_table innodb_buffer_pool_filename The test case is an enhanced version of mysql/mysql-server@0b0c30641fd66336e87394ac28587e40864f8af9 and the code changes are inspired by their fixes. We are also importing and adjusting the test innodb_fts.stopword to get coverage for the variable innodb_ft_user_stopword_table. buf_dump(), buf_load(): Protect srv_buf_dump_filename with LOCK_global_system_variables. fts_load_user_stopword(): Minor cleanup fts_load_stopword(): Remove the parameter global_stopword_table. innobase_fts_load_stopword(): Protect innodb_server_stopword_table against concurrent SET GLOBAL.
Diffstat (limited to 'storage/innobase/buf')
-rw-r--r--storage/innobase/buf/buf0dump.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/storage/innobase/buf/buf0dump.cc b/storage/innobase/buf/buf0dump.cc
index eabc554036a..a45a37a4b3c 100644
--- a/storage/innobase/buf/buf0dump.cc
+++ b/storage/innobase/buf/buf0dump.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2011, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2018, MariaDB Corporation.
+Copyright (c) 2017, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -176,7 +176,7 @@ get_buf_dump_dir()
/* The dump file should be created in the default data directory if
innodb_data_home_dir is set as an empty string. */
- if (strcmp(srv_data_home, "") == 0) {
+ if (!*srv_data_home) {
dump_dir = fil_path_to_mysql_datadir;
} else {
dump_dir = srv_data_home;
@@ -207,9 +207,11 @@ buf_dump(
ulint i;
int ret;
+ mysql_mutex_lock(&LOCK_global_system_variables);
ut_snprintf(full_filename, sizeof(full_filename),
"%s%c%s", get_buf_dump_dir(), SRV_PATH_SEPARATOR,
srv_buf_dump_filename);
+ mysql_mutex_unlock(&LOCK_global_system_variables);
ut_snprintf(tmp_filename, sizeof(tmp_filename),
"%s.incomplete", full_filename);
@@ -513,9 +515,11 @@ buf_load()
/* Ignore any leftovers from before */
buf_load_abort_flag = FALSE;
+ mysql_mutex_lock(&LOCK_global_system_variables);
ut_snprintf(full_filename, sizeof(full_filename),
"%s%c%s", get_buf_dump_dir(), SRV_PATH_SEPARATOR,
srv_buf_dump_filename);
+ mysql_mutex_unlock(&LOCK_global_system_variables);
buf_load_status(STATUS_NOTICE,
"Loading buffer pool(s) from %s", full_filename);