summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/binlog/include
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-01 18:15:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-01 18:15:00 +0000
commita2a2e32c02643a0cec111511220227703fda1cd5 (patch)
tree69cc2b631234c2a8e026b9cd4d72676c61c594df /mysql-test/suite/binlog/include
parentReleasing progress-linux version 1:10.11.8-1~progress7.99u1. (diff)
downloadmariadb-a2a2e32c02643a0cec111511220227703fda1cd5.tar.xz
mariadb-a2a2e32c02643a0cec111511220227703fda1cd5.zip
Merging upstream version 1:11.4.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/binlog/include')
-rw-r--r--mysql-test/suite/binlog/include/binlog_expire_warnings.inc2
-rw-r--r--mysql-test/suite/binlog/include/binlog_incident-master.opt2
-rw-r--r--mysql-test/suite/binlog/include/binlog_ioerr.inc3
-rw-r--r--mysql-test/suite/binlog/include/row_img.test56
4 files changed, 61 insertions, 2 deletions
diff --git a/mysql-test/suite/binlog/include/binlog_expire_warnings.inc b/mysql-test/suite/binlog/include/binlog_expire_warnings.inc
index 3f879bff..04a00f11 100644
--- a/mysql-test/suite/binlog/include/binlog_expire_warnings.inc
+++ b/mysql-test/suite/binlog/include/binlog_expire_warnings.inc
@@ -87,7 +87,7 @@ if ($expect_binlog_off_days_and_seconds_warning) {
}
--let $assert_file = $ofile
---let $assert_select = You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
+--let $assert_select = You need to use --log-bin to make --expire-logs-days, --binlog-expire-logs-seconds or --max-binlog-total-size work.
--let $assert_only_after = Shutdown complete
--source include/assert_grep.inc
diff --git a/mysql-test/suite/binlog/include/binlog_incident-master.opt b/mysql-test/suite/binlog/include/binlog_incident-master.opt
index 57ce0081..4e746bf1 100644
--- a/mysql-test/suite/binlog/include/binlog_incident-master.opt
+++ b/mysql-test/suite/binlog/include/binlog_incident-master.opt
@@ -1 +1 @@
---loose-debug=+d,incident_database_resync_on_replace \ No newline at end of file
+--loose-debug-dbug=+d,incident_database_resync_on_replace
diff --git a/mysql-test/suite/binlog/include/binlog_ioerr.inc b/mysql-test/suite/binlog/include/binlog_ioerr.inc
index da6fb5ac..b710eccc 100644
--- a/mysql-test/suite/binlog/include/binlog_ioerr.inc
+++ b/mysql-test/suite/binlog/include/binlog_ioerr.inc
@@ -17,11 +17,14 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
INSERT INTO t1 VALUES(0);
SET @saved_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug='+d,fail_binlog_write_1';
+# The error injection is in the "legacy" code path.
+SET GLOBAL binlog_legacy_event_pos= 1;
--error ER_ERROR_ON_WRITE
INSERT INTO t1 VALUES(1);
--error ER_ERROR_ON_WRITE
INSERT INTO t1 VALUES(2);
SET SESSION debug_dbug=@saved_dbug;
+SET GLOBAL binlog_legacy_event_pos= 0;
INSERT INTO t1 VALUES(3);
SELECT * FROM t1;
diff --git a/mysql-test/suite/binlog/include/row_img.test b/mysql-test/suite/binlog/include/row_img.test
new file mode 100644
index 00000000..42f3f273
--- /dev/null
+++ b/mysql-test/suite/binlog/include/row_img.test
@@ -0,0 +1,56 @@
+# Auxaliary script for test binlog_row_image
+#
+CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 varchar(100),
+ c3 INT DEFAULT 1000, c4 TEXT);
+CREATE TABLE t2 (c1 INT, c2 char(100), c3 INT DEFAULT 1000, c4 TEXT);
+
+FLUSH BINARY LOGS;
+--let $binlog= query_get_value(SHOW MASTER STATUS, File, 1)
+--let $datadir= `SELECT @@datadir`
+
+--let $img_mode= `SELECT @@binlog_row_image`
+--echo
+--echo #########################################################################
+--echo # binlog_row_image = $img_mode
+--echo #########################################################################
+--echo
+INSERT INTO t1 VALUES(1, "insert_to_t1", 1, repeat('a', 20)),
+ (2, "insert_to_t1", 2, repeat('a', 20)),
+ (3, "insert_to_t1", 3, repeat('a', 20));
+INSERT INTO t1(c1) VALUES(4);
+UPDATE t1 SET c2 = "only_c2_changed";
+UPDATE t1 SET c3 = 1, c4 = "c3_c4_changed";
+DELETE FROM t1 WHERE c1 = 1;
+
+--echo
+--echo # Verify that rows events are binlogged as expeced.
+--echo
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_regex /^\# at .*// /.*SET (@@|TIMESTAMP).*// /.* end_log_pos .*// /xid=\d*/xid=<xid>/
+--exec $MYSQL_BINLOG --force-if-open --verbose --verbose --base64-output=DECODE-ROWS $datadir/$binlog
+
+FLUSH BINARY LOGS;
+--let $binlog= query_get_value(SHOW MASTER STATUS, File, 1)
+--let $datadir= `SELECT @@datadir`
+
+--echo
+--echo # t2 has no primary key.
+--echo # It will binlog full before and after image for all modes if the
+--echo # table has no primary key. FULL_NODUP follows the behavior.
+--echo
+INSERT INTO t2 VALUES(1, "insert_to_t2", 1, repeat('a', 20)),
+ (2, "insert_to_t2", 2, repeat('a', 20)),
+ (3, "insert_to_t2", 3, repeat('a', 20));
+INSERT INTO t2(c1) VALUES(4);
+UPDATE t2 SET c2 = "only_c2_changed";
+UPDATE t2 SET c3 = 1, c4 = "c3_c4_changed";
+DELETE FROM t2 WHERE c1 > 2;
+
+--echo
+--echo # Verify that rows events are binlogged as expeced.
+--echo
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_regex /^\# at .*// /.*SET (@@|TIMESTAMP).*// /.* end_log_pos .*// /xid=\d*/xid=<xid>/
+--exec $MYSQL_BINLOG --force-if-open --verbose --verbose --base64-output=DECODE-ROWS $datadir/$binlog
+
+DROP TABLE t1, t2;