summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@skysql.com>2014-08-06 19:42:03 -0400
committerNirbhay Choubey <nirbhay@skysql.com>2014-08-06 19:42:03 -0400
commit42b6c07ebdd1dfe3bb417354e11e52f94a1fef43 (patch)
tree38f453130b5d713a047abf225e3ea4b1fcb409a8 /mysql-test/t
parentabbdc7ae860e70e30acc92bf4758d45bb8b46925 (diff)
downloadmariadb-git-42b6c07ebdd1dfe3bb417354e11e52f94a1fef43.tar.gz
MDEV-6490: mysqldump unknown option --galera-sst-mode
A new command line option "galera-sst-mode" was introduced in mysqldump as part of fix for MDEV-6316. But, since the fix was pushed to maria-10.0-galera branch, the mysqldump tool supplied with mariadb client deb/rpm packages, does not have this new opion. This fix contains the same patch along with a test case.
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/galera_sst_mode.test49
1 files changed, 49 insertions, 0 deletions
diff --git a/mysql-test/t/galera_sst_mode.test b/mysql-test/t/galera_sst_mode.test
new file mode 100644
index 00000000000..ce76bfad07a
--- /dev/null
+++ b/mysql-test/t/galera_sst_mode.test
@@ -0,0 +1,49 @@
+# Embedded server doesn't support external clients
+--source include/not_embedded.inc
+# Binlog is required
+--source include/have_log_bin.inc
+
+--echo #
+--echo # Test for mysqldump's galera-sst-mode option
+--echo #
+
+--echo #
+--echo # MDEV-6490: mysqldump unknown option --galera-sst-mode
+--echo #
+CREATE DATABASE bug6490;
+USE bug6490;
+CREATE TABLE t1(c1 INT);
+INSERT INTO t1 values (1);
+INSERT INTO t1 values (2);
+
+--echo # @@global.gtid_binlog_state - after
+SELECT @@global.gtid_binlog_state;
+
+--echo # Save the current gtid_binlog_state.
+--let $before= `SELECT @@global.gtid_binlog_state`
+
+--echo # Take a dump of bug6490 database
+--exec $MYSQL_DUMP --galera-sst-mode bug6490 > $MYSQLTEST_VARDIR/tmp/bug6490.sql
+DROP TABLE t1;
+
+--echo # Load the dump
+RESET MASTER;
+--exec $MYSQL -uroot bug6490 < $MYSQLTEST_VARDIR/tmp/bug6490.sql
+
+SELECT * from t1;
+
+--echo # @@global.gtid_binlog_state - after
+SELECT @@global.gtid_binlog_state;
+
+--echo # Compare the two gtid_binlog_state's
+--let $after= `SELECT @@global.gtid_binlog_state`
+if (`SELECT STRCMP($before, $after)`)
+{
+ --die ERROR: The two gtid_binlog_state's did not match.
+}
+
+--echo # Cleanup
+--remove_file $MYSQLTEST_VARDIR/tmp/bug6490.sql
+DROP DATABASE bug6490;
+
+--echo # End of test