summaryrefslogtreecommitdiff
path: root/mysql-test/suite/binlog
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/binlog')
-rw-r--r--mysql-test/suite/binlog/include/mysqlbinlog_row_engine.inc25
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result20
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result26
-rw-r--r--mysql-test/suite/binlog/r/binlog_parallel_replication_ddl.result8
-rw-r--r--mysql-test/suite/binlog/r/binlog_xa_handling.result11
-rw-r--r--mysql-test/suite/binlog/t/binlog_parallel_replication_ddl.test30
-rw-r--r--mysql-test/suite/binlog/t/binlog_xa_handling.test28
7 files changed, 148 insertions, 0 deletions
diff --git a/mysql-test/suite/binlog/include/mysqlbinlog_row_engine.inc b/mysql-test/suite/binlog/include/mysqlbinlog_row_engine.inc
index ce919550b51..874be1dac61 100644
--- a/mysql-test/suite/binlog/include/mysqlbinlog_row_engine.inc
+++ b/mysql-test/suite/binlog/include/mysqlbinlog_row_engine.inc
@@ -1921,3 +1921,28 @@ let $MYSQLD_DATADIR= `select @@datadir`;
DROP TABLE t1;
+--echo #
+--echo # Beginning of 10.2 test
+--echo #
+--echo # MDEV-25460: Assertion `!is_set() || (m_status == DA_OK_BULK &&
+--echo # is_bulk_op())' failed in Diagnostics_area::set_ok_status in my_ok
+--echo # from mysql_sql_stmt_prepare
+--echo #
+
+CREATE TEMPORARY TABLE a (c INT) ENGINE=InnoDB;
+CREATE TABLE b (c INT) ENGINE=InnoDB;
+
+--error ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR
+PREPARE s FROM 'SET STATEMENT binlog_format=ROW FOR SELECT * FROM b';
+
+DROP TABLE b;
+DROP TEMPORARY TABLE a;
+
+CREATE TEMPORARY TABLE t (c INT);
+--error ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR
+PREPARE s FROM 'SET STATEMENT binlog_format=ROW FOR SELECT 1';
+DROP TEMPORARY TABLE t;
+
+--echo #
+--echo # End of 10.2 test
+--echo #
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
index d8a5864ba3d..a1d3adb7c02 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
@@ -6372,3 +6372,23 @@ ROLLBACK /* added by mysqlbinlog */;
# Cleanup.
#
DROP TABLE t1;
+#
+# Beginning of 10.2 test
+#
+# MDEV-25460: Assertion `!is_set() || (m_status == DA_OK_BULK &&
+# is_bulk_op())' failed in Diagnostics_area::set_ok_status in my_ok
+# from mysql_sql_stmt_prepare
+#
+CREATE TEMPORARY TABLE a (c INT) ENGINE=InnoDB;
+CREATE TABLE b (c INT) ENGINE=InnoDB;
+PREPARE s FROM 'SET STATEMENT binlog_format=ROW FOR SELECT * FROM b';
+ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables
+DROP TABLE b;
+DROP TEMPORARY TABLE a;
+CREATE TEMPORARY TABLE t (c INT);
+PREPARE s FROM 'SET STATEMENT binlog_format=ROW FOR SELECT 1';
+ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables
+DROP TEMPORARY TABLE t;
+#
+# End of 10.2 test
+#
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
index a75593055d7..00756368e45 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
@@ -6413,3 +6413,29 @@ ROLLBACK /* added by mysqlbinlog */;
# Cleanup.
#
DROP TABLE t1;
+#
+# Beginning of 10.2 test
+#
+# MDEV-25460: Assertion `!is_set() || (m_status == DA_OK_BULK &&
+# is_bulk_op())' failed in Diagnostics_area::set_ok_status in my_ok
+# from mysql_sql_stmt_prepare
+#
+CREATE TEMPORARY TABLE a (c INT) ENGINE=InnoDB;
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1266 Using storage engine MyISAM for table 'a'
+CREATE TABLE b (c INT) ENGINE=InnoDB;
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1266 Using storage engine MyISAM for table 'b'
+PREPARE s FROM 'SET STATEMENT binlog_format=ROW FOR SELECT * FROM b';
+ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables
+DROP TABLE b;
+DROP TEMPORARY TABLE a;
+CREATE TEMPORARY TABLE t (c INT);
+PREPARE s FROM 'SET STATEMENT binlog_format=ROW FOR SELECT 1';
+ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables
+DROP TEMPORARY TABLE t;
+#
+# End of 10.2 test
+#
diff --git a/mysql-test/suite/binlog/r/binlog_parallel_replication_ddl.result b/mysql-test/suite/binlog/r/binlog_parallel_replication_ddl.result
new file mode 100644
index 00000000000..34d8bbf5999
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_parallel_replication_ddl.result
@@ -0,0 +1,8 @@
+RESET MASTER;
+CREATE OR REPLACE SEQUENCE s1;
+DROP SEQUENCE s1;
+FLUSH LOGS;
+FOUND 2 /GTID [0-9]+-[0-9]+-[0-9]+/ in mysqlbinlog.sql
+The same as above number of samples must be found:
+FOUND 2 /GTID [0-9]+-[0-9]+-[0-9]+ ddl/ in mysqlbinlog.sql
+End of the tests
diff --git a/mysql-test/suite/binlog/r/binlog_xa_handling.result b/mysql-test/suite/binlog/r/binlog_xa_handling.result
new file mode 100644
index 00000000000..7a60fb59b9a
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_xa_handling.result
@@ -0,0 +1,11 @@
+connection default;
+CREATE TABLE t1(f1 int) ENGINE=Innodb;
+XA START 'xa';
+INSERT INTO t1 VALUES(10);
+BINLOG '
+SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=';
+XA END 'xa';
+XA PREPARE 'xa';
+XA ROLLBACK 'xa';
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/t/binlog_parallel_replication_ddl.test b/mysql-test/suite/binlog/t/binlog_parallel_replication_ddl.test
new file mode 100644
index 00000000000..d861ecc96df
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_parallel_replication_ddl.test
@@ -0,0 +1,30 @@
+# Check binlog properties of various DDL:s.
+# Motivated by MDEV-27365.
+#
+--source include/have_log_bin.inc
+--source include/have_binlog_format_mixed.inc
+
+RESET MASTER;
+
+# MDEV-27365 CREATE-or-REPLACE SEQUENCE bilogged without DDL flag
+# Prove it is logged with the DDL flag.
+CREATE OR REPLACE SEQUENCE s1;
+
+# This one has been always correct.
+DROP SEQUENCE s1;
+FLUSH LOGS;
+
+--let $MYSQLD_DATADIR= `select @@datadir`
+--exec $MYSQL_BINLOG --base64-output=decode-rows $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
+
+--let SEARCH_PATTERN= GTID [0-9]+-[0-9]+-[0-9]+
+--let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
+--source include/search_pattern_in_file.inc
+
+--echo The same as above number of samples must be found:
+--let SEARCH_PATTERN= GTID [0-9]+-[0-9]+-[0-9]+ ddl
+--let SEARCH_FILE= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
+--source include/search_pattern_in_file.inc
+--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
+
+--echo End of the tests
diff --git a/mysql-test/suite/binlog/t/binlog_xa_handling.test b/mysql-test/suite/binlog/t/binlog_xa_handling.test
new file mode 100644
index 00000000000..c454e83169e
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_xa_handling.test
@@ -0,0 +1,28 @@
+###############################################################################
+# Bug#19928622: ASSERTION `! IS_SET()' FAILED. | ABORT IN
+# DIAGNOSTICS_AREA::SET_OK_STATUS
+#
+# MDEV-27536 Invalid BINLOG_BASE64_EVENT and assertion Diagnostics_area:: !is_set()
+#
+# Test:
+# =====
+# Begin an XA transaction and execte a DML statement so that XA state becomes
+# XA_ACTIVE. Execute the BINLOG command it should not cause any assert.
+# Execution should be successful.
+###############################################################################
+--source include/have_log_bin.inc
+--source include/have_innodb.inc
+
+--connection default
+CREATE TABLE t1(f1 int) ENGINE=Innodb;
+
+XA START 'xa';
+INSERT INTO t1 VALUES(10);
+BINLOG '
+SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=';
+XA END 'xa';
+XA PREPARE 'xa';
+XA ROLLBACK 'xa';
+
+DROP TABLE t1;