mariadb/mysql-test/r/ps_change_master.result
Nirbhay Choubey 151f967380 MDEV-7640: CHANGE MASTER TO doesn't work with prepared statements
When CHANGE MASTER was executed as a PS, its attributes were wrongly
getting reset toward the end of PREPARE. As a result, the subsequent
executions had no effect. Fixed by making sure that the CHANGE MASTER
attributes are preserved during the lifetime of the PS.
2015-10-11 17:06:03 -04:00

22 lines
578 B
Text

#
# CHANGE MASTER TO doesn't work with prepared statements
#
CHANGE MASTER TO MASTER_HOST='host1', MASTER_USER='user1';
# Master_Host : host1
# Master_User : user1
SET @s := "CHANGE MASTER TO MASTER_HOST='host2'";
PREPARE stmt FROM @s;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
# Master_Host : host2
# Master_User : user1
SET @s := "CHANGE MASTER TO MASTER_USER='user2'";
PREPARE stmt FROM @s;
EXECUTE stmt;
EXECUTE stmt;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
# Master_Host : host2
# Master_User : user2
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
# End of test