summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2013-05-03 01:50:42 +0300
committerMichael Widenius <monty@askmonty.org>2013-05-03 01:50:42 +0300
commit8cdb118a0a4cbc193a233a6aea90feb159844eab (patch)
tree1212f420cec094af31ffe7b05e774df58062f3b7 /sql/sql_repl.cc
parent59830e1ab8d5e60442b5d15729c8ef06132fc827 (diff)
downloadmariadb-git-8cdb118a0a4cbc193a233a6aea90feb159844eab.tar.gz
Fixed: MDEV-4352; LOAD DATA was not multi-source safe
- Calls to cleanup_load_tmpdir() could delete temporary files for another master connection - Concurrent LOAD DATA commands from two master connections could use the same file name Other bug fixes: - Enlarge buffer for connection names with 'special characters' one can't store in filenames Optimization: - Don't do 'lower case' of connection names. We can use cmp_connection_name, where we already have the connection name in lower case. mysql-test/suite/multi_source/load_data.result: Test case for MDEV-4352 mysql-test/suite/multi_source/load_data.test: Test case for MDEV-4352 sql/log_event.cc: Fixed: MDEV-4352 - Calls to cleanup_load_tmpdir() could delete temporary files for another master connection - Concurrent LOAD DATA commands from two master connections could use the same file name The fix was to add the connection name (if one exists) to all slave temporary files used by LOAD DATA sql/rpl_mi.cc: Enlarge buffer for connection names with 'special characters' one can't store in filenames Use mi->cmp_connection_name for connection file names. sql/rpl_rli.cc: Use mi->cmp_connection_name for connection file names. sql/slave.cc: Removed not needed empty line sql/sql_const.h: Added MAX_FILENAME_MBWIDTH to be able to calculate buffer length for connection_names stored in file names sql/sql_repl.cc: Use mi->cmp_connection_name for connection file names.
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index f5f503b9fc8..1dac2aa2039 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -2128,11 +2128,12 @@ int start_slave(THD* thd , Master_info* mi, bool net_report)
create_logfile_name_with_suffix(master_info_file_tmp,
sizeof(master_info_file_tmp),
- master_info_file, 0, &mi->connection_name);
+ master_info_file, 0,
+ &mi->cmp_connection_name);
create_logfile_name_with_suffix(relay_log_info_file_tmp,
sizeof(relay_log_info_file_tmp),
relay_log_info_file, 0,
- &mi->connection_name);
+ &mi->cmp_connection_name);
lock_slave_threads(mi); // this allows us to cleanly read slave_running
// Get a mask of _stopped_ threads
@@ -2378,11 +2379,13 @@ int reset_slave(THD *thd, Master_info* mi)
// and delete these two files
create_logfile_name_with_suffix(master_info_file_tmp,
- sizeof(master_info_file_tmp),
- master_info_file, 0, &mi->connection_name);
+ sizeof(master_info_file_tmp),
+ master_info_file, 0,
+ &mi->cmp_connection_name);
create_logfile_name_with_suffix(relay_log_info_file_tmp,
- sizeof(relay_log_info_file_tmp),
- relay_log_info_file, 0, &mi->connection_name);
+ sizeof(relay_log_info_file_tmp),
+ relay_log_info_file, 0,
+ &mi->cmp_connection_name);
fn_format(fname, master_info_file_tmp, mysql_data_home, "", 4+32);
if (mysql_file_stat(key_file_master_info, fname, &stat_area, MYF(0)) &&
@@ -2549,11 +2552,13 @@ bool change_master(THD* thd, Master_info* mi, bool *master_info_added)
thd_proc_info(thd, "Changing master");
create_logfile_name_with_suffix(master_info_file_tmp,
- sizeof(master_info_file_tmp),
- master_info_file, 0, &mi->connection_name);
+ sizeof(master_info_file_tmp),
+ master_info_file, 0,
+ &mi->cmp_connection_name);
create_logfile_name_with_suffix(relay_log_info_file_tmp,
- sizeof(relay_log_info_file_tmp),
- relay_log_info_file, 0, &mi->connection_name);
+ sizeof(relay_log_info_file_tmp),
+ relay_log_info_file, 0,
+ &mi->cmp_connection_name);
/* if new Master_info doesn't exists, add it */
if (!master_info_index->get_master_info(&mi->connection_name,