summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/mariabackup/rpl_slave_info.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:24:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:24:36 +0000
commit06eaf7232e9a920468c0f8d74dcf2fe8b555501c (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/mariabackup/rpl_slave_info.test
parentInitial commit. (diff)
downloadmariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.tar.xz
mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/mariabackup/rpl_slave_info.test')
-rw-r--r--mysql-test/suite/mariabackup/rpl_slave_info.test89
1 files changed, 89 insertions, 0 deletions
diff --git a/mysql-test/suite/mariabackup/rpl_slave_info.test b/mysql-test/suite/mariabackup/rpl_slave_info.test
new file mode 100644
index 00000000..1c5dd89a
--- /dev/null
+++ b/mysql-test/suite/mariabackup/rpl_slave_info.test
@@ -0,0 +1,89 @@
+--source include/master-slave.inc
+
+--connection slave
+
+--echo ###############
+--echo # If Using_Gtid != 'No', backup gtid_slave_pos
+--echo ########################
+
+--source include/stop_slave.inc
+change master to master_use_gtid=slave_pos;
+--source include/start_slave.inc
+
+--connection master
+CREATE TABLE t(i INT);
+--sync_slave_with_master
+
+--let $using_gtid=query_get_value(SHOW SLAVE STATUS,Using_Gtid,1)
+--echo "using_gtid: $using_gtid"
+
+--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=.2 --slave-info --backup --target-dir=$targetdir;
+--enable_result_log
+
+--let SEARCH_FILE=$targetdir/xtrabackup_slave_info
+--let SEARCH_PATTERN=gtid_slave_pos
+--source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=MASTER_LOG_FILE
+--source include/search_pattern_in_file.inc
+--source include/show_xtrabackup_slave_info.inc
+
+rmdir $targetdir;
+
+--echo ###############
+--echo # If Using_Gtid != 'No' and !gtid_slave_pos, backup master position
+--echo ########################
+
+--source include/stop_slave.inc
+--disable_warnings
+SET GLOBAL gtid_slave_pos="";
+--enable_warnings
+
+--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=.2 --slave-info --backup --target-dir=$targetdir;
+--enable_result_log
+
+--let SEARCH_FILE=$targetdir/xtrabackup_slave_info
+--let SEARCH_PATTERN=gtid_slave_pos
+--source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=MASTER_LOG_FILE
+--source include/search_pattern_in_file.inc
+--source include/show_xtrabackup_slave_info.inc
+
+rmdir $targetdir;
+
+--echo ###############
+--echo # If Using_Gtid == 'No', backup Exec_Master_Log_Pos
+--echo ########################
+
+change master to master_use_gtid=no;
+--source include/start_slave.inc
+
+--connection master
+INSERT INTO t VALUES(1);
+--sync_slave_with_master
+
+--let $using_gtid=query_get_value(SHOW SLAVE STATUS,Using_Gtid,1)
+--echo "using_gtid: $using_gtid"
+
+--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=.2 --slave-info --backup --target-dir=$targetdir;
+--enable_result_log
+
+--let SEARCH_FILE=$targetdir/xtrabackup_slave_info
+--let SEARCH_PATTERN=gtid_slave_pos
+--source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=MASTER_LOG_FILE
+--source include/search_pattern_in_file.inc
+--source include/show_xtrabackup_slave_info.inc
+
+rmdir $targetdir;
+
+# Cleanup
+--connection master
+DROP TABLE t;
+--sync_slave_with_master
+--source include/rpl_end.inc