summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorguilhem@mysql.com <>2004-03-17 10:35:03 +0100
committerguilhem@mysql.com <>2004-03-17 10:35:03 +0100
commit0f3600d51eb8f9bc48ea4bd89730e21153627bc9 (patch)
treec33f645c0ede61c2f00434dcae9577d092d0862d /sql
parentd325d2ab4592e437cc1d37b3c9c43cc79fc8d09e (diff)
downloadmariadb-git-0f3600d51eb8f9bc48ea4bd89730e21153627bc9.tar.gz
Fix for BUG#2922 "Crash (signal11) after "load data from master""
with a testcase. We needed to init_master_info before we flush_master_info in LOAD DATA FROM MASTER.
Diffstat (limited to 'sql')
-rw-r--r--sql/repl_failsafe.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index e687b227946..1edf452d5f6 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -874,7 +874,7 @@ int load_master_data(THD* thd)
cleanup_mysql_results(db_res, cur_table_res - 1, table_res);
- // adjust position in the master
+ // adjust replication coordinates from the master
if (master_status_res)
{
MYSQL_ROW row = mc_mysql_fetch_row(master_status_res);
@@ -887,10 +887,18 @@ int load_master_data(THD* thd)
*/
if (row && row[0] && row[1])
{
+ /*
+ If the slave's master info is not inited, we init it, then we write
+ the new coordinates to it. Must call init_master_info() *before*
+ setting active_mi, because init_master_info() sets active_mi with
+ defaults.
+ */
+ if (init_master_info(active_mi, master_info_file, relay_log_info_file, 0))
+ send_error(&thd->net, ER_MASTER_INFO);
strmake(active_mi->master_log_name, row[0],
sizeof(active_mi->master_log_name));
active_mi->master_log_pos = strtoull(row[1], (char**) 0, 10);
- // don't hit the magic number
+ // at least in recent versions, the condition below should be false
if (active_mi->master_log_pos < BIN_LOG_HEADER_SIZE)
active_mi->master_log_pos = BIN_LOG_HEADER_SIZE;
active_mi->rli.pending = 0;