summaryrefslogtreecommitdiffstats
path: root/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_skip_trx_api_binlog_format.test
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_skip_trx_api_binlog_format.test52
1 files changed, 52 insertions, 0 deletions
diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_skip_trx_api_binlog_format.test b/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_skip_trx_api_binlog_format.test
new file mode 100644
index 00000000..1ea9add8
--- /dev/null
+++ b/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_skip_trx_api_binlog_format.test
@@ -0,0 +1,52 @@
+# Checks if the slave stops executing transactions when master's binlog format
+# is STATEMENT but rpl_skip_tx_api is enabled
+-- source include/have_rocksdb.inc
+-- source include/master-slave.inc
+
+call mtr.add_suppression("Master's binlog format is not ROW but rpl_skip_tx_api is enabled on the slave");
+
+connection slave;
+let $old_rpl_skip_tx_api= `SELECT @@global.rpl_skip_tx_api`;
+set global rpl_skip_tx_api=ON;
+
+connection master;
+let $old_rocksdb_unsafe_for_binlog= `SELECT @@global.rocksdb_unsafe_for_binlog`;
+set global rocksdb_unsafe_for_binlog=1;
+create table t1(a int);
+set session binlog_format=STATEMENT;
+insert into t1 values(1);
+
+# Wait till we hit the binlog format mismatch error
+connection slave;
+let $slave_sql_errno= convert_error(ER_MTS_INCONSISTENT_DATA); # 1756
+let $show_slave_sql_error= 1;
+source include/wait_for_slave_sql_error.inc;
+
+# Print table
+connection slave;
+echo "Table after error";
+select * from t1;
+
+connection slave;
+# Turn off rpl_skip_tx_api and start the slave again
+set global rpl_skip_tx_api=OFF;
+source include/start_slave.inc;
+
+connection slave;
+source include/sync_slave_sql_with_master.inc;
+
+connection slave;
+# Print table again
+echo "Table after error fixed";
+select * from t1;
+
+# Cleanup
+connection master;
+drop table t1;
+eval set global rocksdb_unsafe_for_binlog=$old_rocksdb_unsafe_for_binlog;
+sync_slave_with_master;
+
+connection slave;
+eval set global rpl_skip_tx_api=$old_rpl_skip_tx_api;
+
+-- source include/rpl_end.inc