diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
commit | 3f619478f796eddbba6e39502fe941b285dd97b1 (patch) | |
tree | e2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/main/ps_change_master.test | |
parent | Initial commit. (diff) | |
download | mariadb-upstream.tar.xz mariadb-upstream.zip |
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | mysql-test/main/ps_change_master.test | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/mysql-test/main/ps_change_master.test b/mysql-test/main/ps_change_master.test new file mode 100644 index 00000000..d756b8cd --- /dev/null +++ b/mysql-test/main/ps_change_master.test @@ -0,0 +1,45 @@ +--source include/not_embedded.inc +--source include/have_log_bin.inc + +--echo # +--echo # CHANGE MASTER TO doesn't work with prepared statements +--echo # + +CHANGE MASTER TO MASTER_HOST='host1', MASTER_USER='user1'; + +let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); +let $master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1); + +--echo # Master_Host : $master_host +--echo # Master_User : $master_user + +SET @s := "CHANGE MASTER TO MASTER_HOST='host2'"; +PREPARE stmt FROM @s; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; + +let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); +let $master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1); + +--echo # Master_Host : $master_host +--echo # Master_User : $master_user + +SET @s := "CHANGE MASTER TO MASTER_USER='user2'"; +PREPARE stmt FROM @s; +EXECUTE stmt; +# Multiple executions should not hurt. +EXECUTE stmt; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; + +let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); +let $master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1); + +--echo # Master_Host : $master_host +--echo # Master_User : $master_user + + +# Reset +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root'; + +--echo # End of test |