summaryrefslogtreecommitdiff
path: root/mysql-test/suite/multi_source
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2013-01-30 15:11:36 +0100
committerunknown <knielsen@knielsen-hq.org>2013-01-30 15:11:36 +0100
commitea5632e9d767f1c4d07cb2dae74ec79bec843b7d (patch)
tree135ea4b71d1dfeee1080f59976519c114cc5bbc3 /mysql-test/suite/multi_source
parent6f2680a73c54a5c676f80f6b86c1985aced1dfe4 (diff)
downloadmariadb-git-ea5632e9d767f1c4d07cb2dae74ec79bec843b7d.tar.gz
MDEV-3984: Double free of Master_info * when CHANGE MASTER fails.
When CHANGE MASTER fails, it may or may not have already added the Master_info * to the index. Implement logic that properly handles removal and freeing in both cases.
Diffstat (limited to 'mysql-test/suite/multi_source')
-rw-r--r--mysql-test/suite/multi_source/multisource.result4
-rw-r--r--mysql-test/suite/multi_source/multisource.test9
2 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/suite/multi_source/multisource.result b/mysql-test/suite/multi_source/multisource.result
index c4fb7123e81..cd19b455d82 100644
--- a/mysql-test/suite/multi_source/multisource.result
+++ b/mysql-test/suite/multi_source/multisource.result
@@ -1,3 +1,7 @@
+change master 'abc' to relay_log_file='';
+ERROR HY000: Failed initializing relay log position: Could not find target log during relay log initialization
+change master 'abc2' to master_host='';
+ERROR HY000: Incorrect arguments to MASTER_HOST
change master 'master1' to
master_port=MYPORT_1,
master_host='127.0.0.1',
diff --git a/mysql-test/suite/multi_source/multisource.test b/mysql-test/suite/multi_source/multisource.test
index 7a9ee166ec2..4938a0142d1 100644
--- a/mysql-test/suite/multi_source/multisource.test
+++ b/mysql-test/suite/multi_source/multisource.test
@@ -8,6 +8,15 @@
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
+# MDEV-3984: crash/read of freed memory when changing master with named connection
+# This fails after adding the new master 'abc', check we do not free twice.
+--error ER_RELAY_LOG_INIT
+change master 'abc' to relay_log_file='';
+# This fails before adding the new master, check that we do free it.
+--error ER_WRONG_ARGUMENTS
+change master 'abc2' to master_host='';
+
+
# Start replication from the first master
--replace_result $SERVER_MYPORT_1 MYPORT_1