diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2017-06-19 17:00:09 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2017-06-19 17:20:30 +0000 |
commit | b9a326b6e1c1a4b14b27e7fb634fb5f16981f731 (patch) | |
tree | 80944e5a2a02804eec5cd4d44439b9f3db97ffaa /extra | |
parent | d1e182d603c73e42a18667f3984d6487c9a3b090 (diff) | |
download | mariadb-git-b9a326b6e1c1a4b14b27e7fb634fb5f16981f731.tar.gz |
MDEV-12709 : mariabackup - during backup phase read some innodb parameter
using "show variables", rather than take the value from my.cnf.
"show variables" is more accurate than my.cnf,it also works for parameters
set on the mysqld command line, which is especially important for MTR.
Diffstat (limited to 'extra')
-rw-r--r-- | extra/mariabackup/backup_mysql.cc | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/extra/mariabackup/backup_mysql.cc b/extra/mariabackup/backup_mysql.cc index 2353c7692cb..00fed457304 100644 --- a/extra/mariabackup/backup_mysql.cc +++ b/extra/mariabackup/backup_mysql.cc @@ -344,7 +344,8 @@ get_mysql_vars(MYSQL *connection) char *innodb_data_home_dir_var = NULL; char *innodb_undo_directory_var = NULL; char *innodb_page_size_var = NULL; - + char *innodb_undo_tablespaces_var = NULL; + char *endptr; unsigned long server_version = mysql_get_server_version(connection); bool ret = true; @@ -372,6 +373,7 @@ get_mysql_vars(MYSQL *connection) {"innodb_data_home_dir", &innodb_data_home_dir_var}, {"innodb_undo_directory", &innodb_undo_directory_var}, {"innodb_page_size", &innodb_page_size_var}, + {"innodb_undo_tablespaces", &innodb_undo_tablespaces_var}, {NULL, NULL} }; @@ -460,62 +462,55 @@ get_mysql_vars(MYSQL *connection) } /* get some default values is they are missing from my.cnf */ - if (!check_if_param_set("datadir") && datadir_var && *datadir_var) { + if (datadir_var && *datadir_var) { strmake(mysql_real_data_home, datadir_var, FN_REFLEN - 1); mysql_data_home= mysql_real_data_home; } - if (!check_if_param_set("innodb_data_file_path") - && innodb_data_file_path_var && *innodb_data_file_path_var) { + if (innodb_data_file_path_var && *innodb_data_file_path_var) { innobase_data_file_path = my_strdup( innodb_data_file_path_var, MYF(MY_FAE)); } - if (!check_if_param_set("innodb_data_home_dir") - && innodb_data_home_dir_var && *innodb_data_home_dir_var) { + if (innodb_data_home_dir_var && *innodb_data_home_dir_var) { innobase_data_home_dir = my_strdup( innodb_data_home_dir_var, MYF(MY_FAE)); } - if (!check_if_param_set("innodb_log_group_home_dir") - && innodb_log_group_home_dir_var + if (innodb_log_group_home_dir_var && *innodb_log_group_home_dir_var) { srv_log_group_home_dir = my_strdup( innodb_log_group_home_dir_var, MYF(MY_FAE)); } - if (!check_if_param_set("innodb_undo_directory") - && innodb_undo_directory_var && *innodb_undo_directory_var) { + if (innodb_undo_directory_var && *innodb_undo_directory_var) { srv_undo_dir = my_strdup( innodb_undo_directory_var, MYF(MY_FAE)); } - if (!check_if_param_set("innodb_log_files_in_group") - && innodb_log_files_in_group_var) { - char *endptr; - + if (innodb_log_files_in_group_var) { innobase_log_files_in_group = strtol( innodb_log_files_in_group_var, &endptr, 10); ut_ad(*endptr == 0); } - if (!check_if_param_set("innodb_log_file_size") - && innodb_log_file_size_var) { - char *endptr; - + if (innodb_log_file_size_var) { innobase_log_file_size = strtoll( innodb_log_file_size_var, &endptr, 10); ut_ad(*endptr == 0); } - if (!check_if_param_set("innodb_page_size") && innodb_page_size_var) { - char *endptr; - + if (innodb_page_size_var) { innobase_page_size = strtoll( innodb_page_size_var, &endptr, 10); ut_ad(*endptr == 0); } + if (innodb_undo_tablespaces_var) { + srv_undo_tablespaces = strtoul(innodb_undo_tablespaces_var, &endptr, 10); + ut_ad(*endptr == 0); + } + out: free_mysql_variables(mysql_vars); |