summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/binlog/r
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/r
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/r')
-rw-r--r--mysql-test/suite/binlog/r/binlog_base64_flag.result33
-rw-r--r--mysql-test/suite/binlog/r/binlog_grant.result38
-rw-r--r--mysql-test/suite/binlog/r/binlog_gtid_index.result135
-rw-r--r--mysql-test/suite/binlog/r/binlog_gtid_index_crash.result28
-rw-r--r--mysql-test/suite/binlog/r/binlog_ioerr.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result1
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result21
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result6
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result7
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_old_versions.result70
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result1
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_img.result1365
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result3
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_do_db.result6
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_mysqlbinlog_collate_implicit.result193
-rw-r--r--mysql-test/suite/binlog/r/binlog_unsafe.result4
-rw-r--r--mysql-test/suite/binlog/r/flashback.result54
-rw-r--r--mysql-test/suite/binlog/r/max_binlog_total_size.result123
19 files changed, 1960 insertions, 132 deletions
diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result
index c4c4fddb..4b75b712 100644
--- a/mysql-test/suite/binlog/r/binlog_base64_flag.result
+++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result
@@ -1,7 +1,7 @@
call mtr.add_suppression("BINLOG_BASE64_EVENT: According to the master's version");
call mtr.add_suppression("BINLOG_BASE64_EVENT: Column 1 of table 'test.char128_utf8' cannot be converted");
-DROP TABLE IF EXISTS t1;
-==== Test BUG#32407 ====
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (1), (1);
select * from t1;
a
1
@@ -49,35 +49,6 @@ a
SELECT @binlog_fragment_0, @binlog_fragment_1 as 'NULL','NULL';
@binlog_fragment_0 NULL NULL
NULL NULL NULL
-==== Test --base64-output=never on a binlog with row events ====
-/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
-/*!40019 SET @@session.max_delayed_threads=0*/;
-/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
-DELIMITER /*!*/;
-<#>
-ROLLBACK/*!*/;
-<#>
-use `test`/*!*/;
-SET TIMESTAMP=1196959712/*!*/;
-<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.system_versioning_insert_history=0/*!*/;
-SET @@session.sql_mode=0/*!*/;
-SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
-/*!\C latin1 *//*!*/;
-SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-SET @@session.lc_time_names=0/*!*/;
-SET @@session.collation_database=DEFAULT/*!*/;
-create table t1 (a int) engine= myisam
-/*!*/;
-<#>
-<#>
-<#>
-<#>
-<#>
-DELIMITER ;
-# End of log file
-ROLLBACK /* added by mysqlbinlog */;
-/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
-/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
==== Test non-matching FD event and Row event ====
BINLOG '
4CdYRw8BAAAAYgAAAGYAAAAAAAQANS4xLjE1LW5kYi02LjEuMjQtZGVidWctbG9nAAAAAAAAAAAA
diff --git a/mysql-test/suite/binlog/r/binlog_grant.result b/mysql-test/suite/binlog/r/binlog_grant.result
index edf70561..76cc415d 100644
--- a/mysql-test/suite/binlog/r/binlog_grant.result
+++ b/mysql-test/suite/binlog/r/binlog_grant.result
@@ -16,7 +16,7 @@ set session sql_log_bin = 1;
connection plain;
[plain]
set session sql_log_bin = 1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
**** Variable BINLOG_FORMAT ****
connection root;
[root]
@@ -25,9 +25,9 @@ set session binlog_format = row;
connection plain;
[plain]
set global binlog_format = row;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
set session binlog_format = row;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
**** Clean up ****
disconnect plain;
disconnect root;
@@ -45,7 +45,10 @@ disconnect rpl;
connection default;
DROP USER 'mysqltest_1'@'localhost';
#
-# Start of 10.5 test
+# End of 10.4 tests
+#
+#
+# Start of 10.5 tests
#
#
# MDEV-21743 Split up SUPER privilege to smaller privileges
@@ -61,29 +64,29 @@ SHOW GRANTS FOR user1@localhost;
Grants for user1@localhost
GRANT USAGE ON *.* TO `user1`@`localhost`
DROP USER user1@localhost;
-# Test if SHOW BINARY LOGS and SHOW BINGLOG STATUS are not allowed without REPLICATION CLIENT or SUPER
+# Test if SHOW BINARY LOGS and SHOW BINGLOG STATUS are not allowed without REPLICATION CLIENT
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION CLIENT, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION CLIENT ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SHOW MASTER LOGS;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG MONITOR privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG MONITOR privilege(s) for this operation
SHOW BINARY LOGS;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG MONITOR privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG MONITOR privilege(s) for this operation
SHOW BINLOG STATUS;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG MONITOR privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG MONITOR privilege(s) for this operation
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test if PURGE BINARY LOGS is not allowed without BINLOG ADMIN or SUPER
+# Test if PURGE BINARY LOGS is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
PURGE BINARY LOGS BEFORE '2001-01-01 00:00:00';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
disconnect user1;
connection default;
DROP USER user1@localhost;
@@ -96,15 +99,6 @@ PURGE BINARY LOGS BEFORE '2001-01-01 00:00:00';
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test if PURGE BINLOG is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,"*NO-ONE*";
-connection user1;
-PURGE BINARY LOGS BEFORE '2001-01-01 00:00:00';
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
# Test if SHOW BINLOG EVENTS is not allowed without BINLOG MONITOR
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
@@ -142,7 +136,7 @@ connect user1,localhost,user1,,;
RENAME TABLE t1 to t2;
connection default;
REVOKE BINLOG REPLAY ON *.* FROM user1@localhost;
-call mtr.add_suppression("Access denied; you need (at least one of) the SUPER, BINLOG REPLAY privilege(s) for this operation");
+call mtr.add_suppression("Access denied; you need (at least one of) the BINLOG REPLAY privilege(s) for this operation");
# Privilege errors are expected now:
connection user1;
connection default;
diff --git a/mysql-test/suite/binlog/r/binlog_gtid_index.result b/mysql-test/suite/binlog/r/binlog_gtid_index.result
new file mode 100644
index 00000000..e53e1aac
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_gtid_index.result
@@ -0,0 +1,135 @@
+SET GLOBAL binlog_gtid_index= 0;
+SET GLOBAL binlog_gtid_index= 1;
+SET @gtid1= @@gtid_binlog_pos;
+CREATE TABLE t1 (a INT PRIMARY KEY);
+SET @gtid2= @@gtid_binlog_pos;
+INSERT INTO t1 VALUES (1);
+SET @gtid3= @@gtid_binlog_pos;
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+SET @gtid4= @@gtid_binlog_pos;
+INSERT INTO t1 VALUES (5);
+SET @gtid5= @@gtid_binlog_pos;
+SET @gtid6= @@gtid_binlog_pos;
+INSERT INTO t1 VALUES (106);
+INSERT INTO t1 VALUES (107);
+Ok
+1
+Ok
+1
+Ok
+1
+Ok
+1
+Ok
+1
+Ok
+1
+FLUSH BINARY LOGS;
+Ok
+1
+Ok
+1
+Ok
+1
+Ok
+1
+Ok
+1
+Ok
+1
+*** Test that purge deletes the gtid index files. ***
+FLUSH BINARY LOGS;
+INSERT INTO t1 VALUES (200);
+FLUSH BINARY LOGS;
+INSERT INTO t1 VALUES (201);
+FLUSH BINARY LOGS;
+INSERT INTO t1 VALUES (202);
+PURGE BINARY LOGS TO 'FILE';
+*** Test missed index lookup due to missing or corrupt index file.
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+INSERT INTO t1 VALUES (301);
+INSERT INTO t1 VALUES (302);
+INSERT INTO t1 VALUES (303);
+SET @gtid_pos= @@GLOBAL.gtid_binlog_pos;
+INSERT INTO t1 VALUES (304);
+INSERT INTO t1 VALUES (305);
+FLUSH NO_WRITE_TO_BINLOG STATUS;
++++ Initial status:
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 0
+Binlog_gtid_index_miss 0
++++ GTID Lookup in good index.
+Gtid_Lookup_Ok
+1
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 1
+Binlog_gtid_index_miss 0
++++ GTID Lookup, index file is missing.
+Gtid_Lookup_Ok
+1
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 1
+Binlog_gtid_index_miss 1
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+INSERT INTO t1 VALUES (306);
+SET @gtid_pos= @@GLOBAL.gtid_binlog_pos;
+INSERT INTO t1 VALUES (307);
+INSERT INTO t1 VALUES (308);
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
++++ GTID Lookup, first page of index is corrupt.
+Gtid_Lookup_Ok
+1
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 1
+Binlog_gtid_index_miss 2
+SET @old_page_size= @@GLOBAL.binlog_gtid_index_page_size;
+SET @old_span_min= @@GLOBAL.binlog_gtid_index_span_min;
+SET GLOBAL binlog_gtid_index_page_size= 64;
+SET GLOBAL binlog_gtid_index_span_min= 1;
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+INSERT INTO t1 VALUES (310);
+INSERT INTO t1 VALUES (311);
+INSERT INTO t1 VALUES (312);
+SET @gtid_pos= @@GLOBAL.gtid_binlog_pos;
+INSERT INTO t1 VALUES (313);
+INSERT INTO t1 VALUES (314);
+INSERT INTO t1 VALUES (315);
+INSERT INTO t1 VALUES (316);
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+SET GLOBAL binlog_gtid_index_page_size= @old_page_size;
+SET GLOBAL binlog_gtid_index_span_min= @old_span_min;
++++ GTID Lookup, root page of index is corrupt.
+Gtid_Lookup_Ok
+1
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 1
+Binlog_gtid_index_miss 3
+*** Test BINLOG_GTID_POS() with too-large offset.
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+INSERT INTO t1 VALUES (401);
+INSERT INTO t1 VALUES (402);
++++ Test the hot index.
+SELECT BINLOG_GTID_POS('FILE', 100000000);
+BINLOG_GTID_POS('FILE', 100000000)
+NULL
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 2
+Binlog_gtid_index_miss 3
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
++++ Test the cold index.
+SELECT BINLOG_GTID_POS('FILE', 100000000);
+BINLOG_GTID_POS('FILE', 100000000)
+NULL
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 3
+Binlog_gtid_index_miss 3
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/binlog_gtid_index_crash.result b/mysql-test/suite/binlog/r/binlog_gtid_index_crash.result
new file mode 100644
index 00000000..91e5a6c9
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_gtid_index_crash.result
@@ -0,0 +1,28 @@
+*** Test that binlog GTID index is recovered after a crash.
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+Ok
+1
+Ok
+1
+Ok
+1
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 3
+Binlog_gtid_index_miss 0
+*** Crash the server, check that GTID index can be used after restart.
+SET debug_dbug="d,crash_shutdown";
+shutdown;
+ERROR HY000: Lost connection to server during query
+FLUSH NO_WRITE_TO_BINLOG STATUS;
+Ok
+1
+Ok
+1
+Ok
+1
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 3
+Binlog_gtid_index_miss 0
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/binlog_ioerr.result b/mysql-test/suite/binlog/r/binlog_ioerr.result
index e4f00a01..aa4042d3 100644
--- a/mysql-test/suite/binlog/r/binlog_ioerr.result
+++ b/mysql-test/suite/binlog/r/binlog_ioerr.result
@@ -4,11 +4,13 @@ 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';
+SET GLOBAL binlog_legacy_event_pos= 1;
INSERT INTO t1 VALUES(1);
ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device")
INSERT INTO t1 VALUES(2);
ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device")
SET SESSION debug_dbug=@saved_dbug;
+SET GLOBAL binlog_legacy_event_pos= 0;
INSERT INTO t1 VALUES(3);
SELECT * FROM t1;
a
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result
index d6977880..87152e82 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result
@@ -1,4 +1,5 @@
RESET MASTER;
+RESET MASTER;
#
# MDEV-30698 Cover missing test cases for mariadb-binlog options
# --raw [and] --flashback
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
index b793887a..4ae2a7d4 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
@@ -1934,7 +1934,6 @@ START TRANSACTION
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
-SET @@session.time_zone='SYSTEM'/*!*/;
COMMIT
/*!*/;
# at #
@@ -2320,6 +2319,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c37 NATIONAL CHAR)
/*!*/;
# at #
@@ -2378,6 +2378,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c38 NATIONAL CHAR(0))
/*!*/;
# at #
@@ -2436,6 +2437,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c39 NATIONAL CHAR(1))
/*!*/;
# at #
@@ -2494,6 +2496,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c40 NATIONAL CHAR(255))
/*!*/;
# at #
@@ -2576,6 +2579,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c41 CHAR CHARACTER SET UCS2)
/*!*/;
# at #
@@ -2634,6 +2638,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c42 CHAR(0) CHARACTER SET UCS2)
/*!*/;
# at #
@@ -2692,6 +2697,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c43 CHAR(1) CHARACTER SET UCS2)
/*!*/;
# at #
@@ -2750,6 +2756,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c44 CHAR(255) CHARACTER SET UCS2)
/*!*/;
# at #
@@ -3064,6 +3071,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c49 NATIONAL VARCHAR(0))
/*!*/;
# at #
@@ -3122,6 +3130,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c50 NATIONAL VARCHAR(1))
/*!*/;
# at #
@@ -3180,6 +3189,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c51 NATIONAL VARCHAR(255))
/*!*/;
# at #
@@ -3262,6 +3272,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c52 NATIONAL VARCHAR(261))
/*!*/;
# at #
@@ -3344,6 +3355,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c53 VARCHAR(0) CHARACTER SET ucs2)
/*!*/;
# at #
@@ -3402,6 +3414,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c54 VARCHAR(1) CHARACTER SET ucs2)
/*!*/;
# at #
@@ -3460,6 +3473,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c55 VARCHAR(255) CHARACTER SET ucs2)
/*!*/;
# at #
@@ -3518,6 +3532,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c56 VARCHAR(261) CHARACTER SET ucs2)
/*!*/;
# at #
@@ -4656,6 +4671,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c67 TINYTEXT CHARACTER SET UCS2)
/*!*/;
# at #
@@ -4714,6 +4730,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c70 TEXT CHARACTER SET UCS2)
/*!*/;
# at #
@@ -4772,6 +4789,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c73 MEDIUMTEXT CHARACTER SET UCS2)
/*!*/;
# at #
@@ -4830,6 +4848,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c76 LONGTEXT CHARACTER SET UCS2)
/*!*/;
# at #
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 9e88917c..c0c6b7db 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
@@ -2275,6 +2275,7 @@ SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=utf8mb3,@@session.collation_connection=33,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
@@ -5367,6 +5368,7 @@ SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=utf8mb3,@@session.collation_connection=33,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
@@ -5767,6 +5769,7 @@ SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=utf8mb3,@@session.collation_connection=33,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
@@ -5781,6 +5784,7 @@ c_1_n INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t2 (
c_2_1 DATE,
c_2_2 VARCHAR(255),
@@ -5793,6 +5797,7 @@ c_2_n INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t3 (
c_3_1 DATE,
c_3_2 VARCHAR(255),
@@ -6405,6 +6410,7 @@ SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=utf8mb3,@@session.collation_connection=33,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
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 916bed0c..9186d065 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
@@ -2273,6 +2273,7 @@ SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=utf8mb3,@@session.collation_connection=33,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
@@ -2550,7 +2551,6 @@ START TRANSACTION
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
-SET @@session.time_zone='SYSTEM'/*!*/;
COMMIT
/*!*/;
# at #
@@ -5388,6 +5388,7 @@ SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=utf8mb3,@@session.collation_connection=33,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
@@ -5794,6 +5795,7 @@ SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=utf8mb3,@@session.collation_connection=33,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
@@ -5808,6 +5810,7 @@ c_1_n INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t2 (
c_2_1 DATE,
c_2_2 VARCHAR(255),
@@ -5820,6 +5823,7 @@ c_2_n INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t3 (
c_3_1 DATE,
c_3_2 VARCHAR(255),
@@ -6442,6 +6446,7 @@ SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=utf8mb3,@@session.collation_connection=33,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
index 5735b9b8..1a49ad29 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
@@ -151,6 +151,7 @@ SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=X,@@session.collation_connection=X,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
@@ -164,6 +165,7 @@ c2 VARCHAR(20)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t2 (
c1 INT,
c2 VARCHAR(20)
diff --git a/mysql-test/suite/binlog/r/binlog_old_versions.result b/mysql-test/suite/binlog/r/binlog_old_versions.result
deleted file mode 100644
index 30b64535..00000000
--- a/mysql-test/suite/binlog/r/binlog_old_versions.result
+++ /dev/null
@@ -1,70 +0,0 @@
-==== Read binlog with v2 row events ====
-SELECT * FROM t1 ORDER BY a;
-a b
-0 last_insert_id
-1 one
-3 last stm in trx: next event should be xid
-4 four
-62046 random
-SELECT * FROM t2 ORDER BY a;
-a b
-3 first stm in trx
-SELECT COUNT(*) FROM t3;
-COUNT(*)
-17920
-DROP TABLE t1, t2, t3;
-==== Read modern binlog (version 5.1.23) ====
-SELECT * FROM t1 ORDER BY a;
-a b
-0 last_insert_id
-1 one
-3 last stm in trx: next event should be xid
-4 four
-674568 random
-SELECT * FROM t2 ORDER BY a;
-a b
-3 first stm in trx
-SELECT COUNT(*) FROM t3;
-COUNT(*)
-17920
-DROP TABLE t1, t2, t3;
-==== Read binlog from version 5.1.17 ====
-SELECT * FROM t1 ORDER BY a;
-a b
-0 last_insert_id
-1 one
-3 last stm in trx: next event should be xid
-4 four
-764247 random
-SELECT * FROM t2 ORDER BY a;
-a b
-3 first stm in trx
-SELECT COUNT(*) FROM t3;
-COUNT(*)
-17920
-DROP TABLE t1, t2, t3;
-==== Read binlog from version 4.1 ====
-SELECT * FROM t1 ORDER BY a;
-a b
-0 last_insert_id
-4 four
-190243 random
-SELECT COUNT(*) FROM t3;
-COUNT(*)
-17920
-DROP TABLE t1, t3;
-==== Read binlog from telco tree (mysql-5.1-telco-6.1) ====
-SELECT * FROM t1 ORDER BY a;
-a b
-0 last_insert_id
-1 one
-3 last stm in trx: next event should be xid
-4 four
-703356 random
-SELECT * FROM t2 ORDER BY a;
-a b
-3 first stm in trx
-SELECT COUNT(*) FROM t3;
-COUNT(*)
-17920
-DROP TABLE t1, t2, t3;
diff --git a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
index c02912b8..de8a9e89 100644
--- a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
@@ -97,6 +97,7 @@ SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=X,@@session.collation_connection=X,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8)
diff --git a/mysql-test/suite/binlog/r/binlog_row_img.result b/mysql-test/suite/binlog/r/binlog_row_img.result
new file mode 100644
index 00000000..b4c4f26e
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_row_img.result
@@ -0,0 +1,1365 @@
+#
+# FULL_NODUP mode works as expected
+#
+SET binlog_row_image = "FULL_NODUP";
+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;
+
+#########################################################################
+# binlog_row_image = FULL_NODUP
+#########################################################################
+
+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;
+
+# Verify that rows events are binlogged as expeced.
+
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# Warning: this binlog is either in use or was not closed properly.
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t1 VALUES(1, "insert_to_t1", 1, repeat('a', 20)),
+#Q> (2, "insert_to_t1", 2, repeat('a', 20)),
+#Q> (3, "insert_to_t1", 3, repeat('a', 20))
+### INSERT INTO `test`.`t1`
+### SET
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t1`
+### SET
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t1`
+### SET
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
+/*!\C latin1 *//*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t1(c1) VALUES(4)
+### INSERT INTO `test`.`t1`
+### SET
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2=NULL /* VARSTRING(100) meta=100 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t1 SET c2 = "only_c2_changed"
+### UPDATE `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2=NULL /* VARSTRING(100) meta=100 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t1 SET c3 = 1, c4 = "c3_c4_changed"
+### UPDATE `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> DELETE FROM t1 WHERE c1 = 1
+### DELETE FROM `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+FLUSH BINARY LOGS;
+
+# t2 has no primary key.
+# It will binlog full before and after image for all modes if the
+# table has no primary key. FULL_NODUP follows the behavior.
+
+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;
+
+# Verify that rows events are binlogged as expeced.
+
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# Warning: this binlog is either in use or was not closed properly.
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t2 VALUES(1, "insert_to_t2", 1, repeat('a', 20)),
+#Q> (2, "insert_to_t2", 2, repeat('a', 20)),
+#Q> (3, "insert_to_t2", 3, repeat('a', 20))
+### INSERT INTO `test`.`t2`
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
+/*!\C latin1 *//*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t2(c1) VALUES(4)
+### INSERT INTO `test`.`t2`
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2=NULL /* STRING(100) meta=65124 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t2 SET c2 = "only_c2_changed"
+### UPDATE `test`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2=NULL /* STRING(100) meta=65124 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t2 SET c3 = 1, c4 = "c3_c4_changed"
+### UPDATE `test`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> DELETE FROM t2 WHERE c1 > 2
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 2
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+DROP TABLE t1, t2;
+#
+# MINIMAL mode works as expected
+#
+SET binlog_row_image = "MINIMAL";
+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;
+
+#########################################################################
+# binlog_row_image = MINIMAL
+#########################################################################
+
+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;
+
+# Verify that rows events are binlogged as expeced.
+
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# Warning: this binlog is either in use or was not closed properly.
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t1 VALUES(1, "insert_to_t1", 1, repeat('a', 20)),
+#Q> (2, "insert_to_t1", 2, repeat('a', 20)),
+#Q> (3, "insert_to_t1", 3, repeat('a', 20))
+### INSERT INTO `test`.`t1`
+### SET
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t1`
+### SET
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t1`
+### SET
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
+/*!\C latin1 *//*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t1(c1) VALUES(4)
+### INSERT INTO `test`.`t1`
+### SET
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t1 SET c2 = "only_c2_changed"
+### UPDATE `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### SET
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### SET
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### SET
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### SET
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t1 SET c3 = 1, c4 = "c3_c4_changed"
+### UPDATE `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### SET
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### SET
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### SET
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### SET
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> DELETE FROM t1 WHERE c1 = 1
+### DELETE FROM `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+FLUSH BINARY LOGS;
+
+# t2 has no primary key.
+# It will binlog full before and after image for all modes if the
+# table has no primary key. FULL_NODUP follows the behavior.
+
+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;
+
+# Verify that rows events are binlogged as expeced.
+
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# Warning: this binlog is either in use or was not closed properly.
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t2 VALUES(1, "insert_to_t2", 1, repeat('a', 20)),
+#Q> (2, "insert_to_t2", 2, repeat('a', 20)),
+#Q> (3, "insert_to_t2", 3, repeat('a', 20))
+### INSERT INTO `test`.`t2`
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
+/*!\C latin1 *//*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t2(c1) VALUES(4)
+### INSERT INTO `test`.`t2`
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2=NULL /* STRING(100) meta=65124 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t2 SET c2 = "only_c2_changed"
+### UPDATE `test`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2=NULL /* STRING(100) meta=65124 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t2 SET c3 = 1, c4 = "c3_c4_changed"
+### UPDATE `test`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> DELETE FROM t2 WHERE c1 > 2
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 2
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+DROP TABLE t1, t2;
+#
+# NOBLOB mode works as expected
+#
+SET binlog_row_image = "NOBLOB";
+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;
+
+#########################################################################
+# binlog_row_image = NOBLOB
+#########################################################################
+
+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;
+
+# Verify that rows events are binlogged as expeced.
+
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# Warning: this binlog is either in use or was not closed properly.
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t1 VALUES(1, "insert_to_t1", 1, repeat('a', 20)),
+#Q> (2, "insert_to_t1", 2, repeat('a', 20)),
+#Q> (3, "insert_to_t1", 3, repeat('a', 20))
+### INSERT INTO `test`.`t1`
+### SET
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t1`
+### SET
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t1`
+### SET
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
+/*!\C latin1 *//*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t1(c1) VALUES(4)
+### INSERT INTO `test`.`t1`
+### SET
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2=NULL /* VARSTRING(100) meta=100 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t1 SET c2 = "only_c2_changed"
+### UPDATE `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2=NULL /* VARSTRING(100) meta=100 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t1 SET c3 = 1, c4 = "c3_c4_changed"
+### UPDATE `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> DELETE FROM t1 WHERE c1 = 1
+### DELETE FROM `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+FLUSH BINARY LOGS;
+
+# t2 has no primary key.
+# It will binlog full before and after image for all modes if the
+# table has no primary key. FULL_NODUP follows the behavior.
+
+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;
+
+# Verify that rows events are binlogged as expeced.
+
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# Warning: this binlog is either in use or was not closed properly.
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t2 VALUES(1, "insert_to_t2", 1, repeat('a', 20)),
+#Q> (2, "insert_to_t2", 2, repeat('a', 20)),
+#Q> (3, "insert_to_t2", 3, repeat('a', 20))
+### INSERT INTO `test`.`t2`
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
+/*!\C latin1 *//*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t2(c1) VALUES(4)
+### INSERT INTO `test`.`t2`
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2=NULL /* STRING(100) meta=65124 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t2 SET c2 = "only_c2_changed"
+### UPDATE `test`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2=NULL /* STRING(100) meta=65124 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t2 SET c3 = 1, c4 = "c3_c4_changed"
+### UPDATE `test`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> DELETE FROM t2 WHERE c1 > 2
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 2
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+DROP TABLE t1, t2;
+#
+# FULL mode works as expected
+#
+SET binlog_row_image = "FULL";
+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;
+
+#########################################################################
+# binlog_row_image = FULL
+#########################################################################
+
+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;
+
+# Verify that rows events are binlogged as expeced.
+
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# Warning: this binlog is either in use or was not closed properly.
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t1 VALUES(1, "insert_to_t1", 1, repeat('a', 20)),
+#Q> (2, "insert_to_t1", 2, repeat('a', 20)),
+#Q> (3, "insert_to_t1", 3, repeat('a', 20))
+### INSERT INTO `test`.`t1`
+### SET
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t1`
+### SET
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t1`
+### SET
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
+/*!\C latin1 *//*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t1(c1) VALUES(4)
+### INSERT INTO `test`.`t1`
+### SET
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2=NULL /* VARSTRING(100) meta=100 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t1 SET c2 = "only_c2_changed"
+### UPDATE `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2=NULL /* VARSTRING(100) meta=100 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t1 SET c3 = 1, c4 = "c3_c4_changed"
+### UPDATE `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> DELETE FROM t1 WHERE c1 = 1
+### DELETE FROM `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+FLUSH BINARY LOGS;
+
+# t2 has no primary key.
+# It will binlog full before and after image for all modes if the
+# table has no primary key. FULL_NODUP follows the behavior.
+
+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;
+
+# Verify that rows events are binlogged as expeced.
+
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# Warning: this binlog is either in use or was not closed properly.
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t2 VALUES(1, "insert_to_t2", 1, repeat('a', 20)),
+#Q> (2, "insert_to_t2", 2, repeat('a', 20)),
+#Q> (3, "insert_to_t2", 3, repeat('a', 20))
+### INSERT INTO `test`.`t2`
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
+/*!\C latin1 *//*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t2(c1) VALUES(4)
+### INSERT INTO `test`.`t2`
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2=NULL /* STRING(100) meta=65124 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t2 SET c2 = "only_c2_changed"
+### UPDATE `test`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2=NULL /* STRING(100) meta=65124 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t2 SET c3 = 1, c4 = "c3_c4_changed"
+### UPDATE `test`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> DELETE FROM t2 WHERE c1 > 2
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 2
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+DROP TABLE t1, t2;
+RESET MASTER;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
index f9dc5d64..380e6f86 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
@@ -99,6 +99,7 @@ SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=X,@@session.collation_connection=X,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8)
@@ -126,6 +127,7 @@ START TRANSACTION
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=XXX/*!*/;
+SET @@session.character_set_collations=''/*!*/;
INSERT INTO t1 VALUES ('ä(i2)')
/*!*/;
# at #
@@ -171,6 +173,7 @@ START TRANSACTION
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=XXX/*!*/;
+SET @@session.character_set_collations=''/*!*/;
INSERT INTO t1 VALUES ('ä(p2)')
/*!*/;
# at #
diff --git a/mysql-test/suite/binlog/r/binlog_stm_do_db.result b/mysql-test/suite/binlog/r/binlog_stm_do_db.result
index c39404ae..391158b1 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_do_db.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_do_db.result
@@ -1,6 +1,6 @@
RESET MASTER;
-SET @old_isolation_level= @@session.tx_isolation;
-SET @@session.tx_isolation= 'READ-COMMITTED';
+SET @old_isolation_level= @@session.transaction_isolation;
+SET @@session.transaction_isolation= 'READ-COMMITTED';
CREATE DATABASE b42829;
use b42829;
CREATE TABLE t1 (x int, y int) engine=InnoDB;
@@ -43,4 +43,4 @@ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `b42829`; CREATE TABLE t2 (x int, y int) engine=InnoDB
DROP DATABASE b42829;
DROP DATABASE b42829_filtered;
-SET @@session.tx_isolation= @old_isolation_level;
+SET @@session.transaction_isolation= @old_isolation_level;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_mysqlbinlog_collate_implicit.result b/mysql-test/suite/binlog/r/binlog_stm_mysqlbinlog_collate_implicit.result
new file mode 100644
index 00000000..1b9afbe6
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_stm_mysqlbinlog_collate_implicit.result
@@ -0,0 +1,193 @@
+RESET MASTER;
+SET timestamp=1000000000;
+#
+# MDEV-30164 System variable for default collations
+#
+SET character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin';
+CREATE TABLE t1 (a VARCHAR(20));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb4);
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin);
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3);
+INSERT INTO t1 VALUES ('a00');
+INSERT INTO t1 VALUES (_utf8mb3'a01-utf8mb3');
+INSERT INTO t1 VALUES (_utf8mb4'a01-utf8mb4');
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (?)';
+EXECUTE stmt USING _utf8mb3'a02-utf8mb3';
+EXECUTE stmt USING _utf8mb4'a02-utf8mb4';
+EXECUTE stmt USING CONVERT('a03-utf8mb3' USING utf8mb3);
+EXECUTE stmt USING CONVERT('a03-utf8mb4' USING utf8mb4);
+EXECUTE stmt USING IF(0,CONVERT('a04-utf8mb3' USING utf8mb3),CONVERT('a03-utf8mb4' USING utf8mb4));
+EXECUTE stmt USING IF(1,CONVERT('a04-utf8mb3' USING utf8mb3),CONVERT('a03-utf8mb4' USING utf8mb4));
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
+PREPARE stmt FROM 'CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb4)';
+EXECUTE stmt;
+DROP TABLE t1;
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM 'CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3)';
+EXECUTE stmt;
+DROP TABLE t1;
+DEALLOCATE PREPARE stmt;
+EXECUTE IMMEDIATE 'CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb4)';
+DROP TABLE t1;
+EXECUTE IMMEDIATE 'CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3)';
+DROP TABLE t1;
+FLUSH LOGS;
+
+--- ---- ---
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
+/*!40019 SET @@session.max_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+ROLLBACK/*!*/;
+use `test`/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.pseudo_thread_id=999999999/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=1, @@session.system_versioning_insert_history=0/*!*/;
+SET @@session.sql_mode=#/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=#/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+CREATE TABLE t1 (a VARCHAR(20))
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb4)
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin)
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3)
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+INSERT INTO t1 VALUES ('a00')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+INSERT INTO t1 VALUES (_utf8mb3'a01-utf8mb3')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+INSERT INTO t1 VALUES (_utf8mb4'a01-utf8mb4')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+INSERT INTO t1 VALUES ('a02-utf8mb3')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+INSERT INTO t1 VALUES ('a02-utf8mb4')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+INSERT INTO t1 VALUES ('a03-utf8mb3')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+INSERT INTO t1 VALUES ('a03-utf8mb4')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+INSERT INTO t1 VALUES ('a03-utf8mb4')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+INSERT INTO t1 VALUES ('a04-utf8mb3')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb4)
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3)
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb4)
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3)
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result
index 0c0b0e77..67849fc7 100644
--- a/mysql-test/suite/binlog/r/binlog_unsafe.result
+++ b/mysql-test/suite/binlog/r/binlog_unsafe.result
@@ -2338,11 +2338,7 @@ Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave
UPDATE t1 SET a=1 LIMIT 1;
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted
DELETE FROM t1 LIMIT 1;
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted
CREATE PROCEDURE p1()
BEGIN
INSERT INTO t1 SELECT * FROM t1 LIMIT 1;
diff --git a/mysql-test/suite/binlog/r/flashback.result b/mysql-test/suite/binlog/r/flashback.result
index ec767f62..6ae3e194 100644
--- a/mysql-test/suite/binlog/r/flashback.result
+++ b/mysql-test/suite/binlog/r/flashback.result
@@ -706,6 +706,60 @@ DROP TABLE t1;
# MDEV-30698 Cover missing test cases for mariadb-binlog options
# --raw [and] --flashback
#
+#
+# < CASE 8 >
+# Verify flashback works well for binlog_row_image full_nodup mode
+#
+CREATE TABLE t1 (
+c01 TINYINT PRIMARY KEY,
+c02 SMALLINT,
+c03 MEDIUMINT,
+c04 INT,
+c05 BIGINT,
+c06 CHAR(10),
+c07 VARCHAR(20),
+c08 TEXT,
+c09 ENUM('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight'),
+c10 SET('black', 'white', 'red', 'yellow'),
+c11 TIMESTAMP(3),
+c12 DATETIME(3)
+) ENGINE = InnoDB;
+INSERT INTO t1 VALUES (1, 1, 1, 1, 1, 'A', 'A', 'A', 'one', 'black',
+'2023-11-26 10:00:00.123', '2023-11-26 10:00:00');
+INSERT INTO t1 VALUES (2, 1, 1, 1, 1, 'A', 'A', 'A', 'one', 'black',
+'2023-11-26 10:00:00.123', '2023-11-26 10:00:00');
+INSERT INTO t1 VALUES (3, 1, NULL, 1, 1, 'A', 'A', 'A', 'one', 'black',
+'2023-11-26 10:00:00.123', NULL);
+INSERT INTO t1 VALUES (4, 1, NULL, 1, 1, 'A', 'A', 'A', 'one', 'black',
+'2023-11-26 10:00:00.123', NULL);
+FLUSH BINARY LOGS;
+# The update includes the cases that
+# Value -> Value
+# Value -> NULL
+# NULL -> value
+# and the changed null bits in both first and second null byte
+UPDATE t1 SET c02 = NULL, c03 = 2, c09 = 'two',
+c10 = NULL, c12 = '2023-11-26 11:00:00';
+FLUSH BINARY LOGS;
+#
+# Data before flashback
+#
+SELECT * FROM t1;
+c01 c02 c03 c04 c05 c06 c07 c08 c09 c10 c11 c12
+1 NULL 2 1 1 A A A two NULL 2023-11-26 10:00:00.123 2023-11-26 11:00:00.000
+2 NULL 2 1 1 A A A two NULL 2023-11-26 10:00:00.123 2023-11-26 11:00:00.000
+3 NULL 2 1 1 A A A two NULL 2023-11-26 10:00:00.123 2023-11-26 11:00:00.000
+4 NULL 2 1 1 A A A two NULL 2023-11-26 10:00:00.123 2023-11-26 11:00:00.000
+#
+# Data after flashback
+#
+SELECT * FROM t1;
+c01 c02 c03 c04 c05 c06 c07 c08 c09 c10 c11 c12
+1 1 1 1 1 A A A one black 2023-11-26 10:00:00.123 2023-11-26 10:00:00.000
+2 1 1 1 1 A A A one black 2023-11-26 10:00:00.123 2023-11-26 10:00:00.000
+3 1 NULL 1 1 A A A one black 2023-11-26 10:00:00.123 NULL
+4 1 NULL 1 1 A A A one black 2023-11-26 10:00:00.123 NULL
+DROP TABLE t1;
SET binlog_format=statement;
Warnings:
Warning 1105 MariaDB Galera and flashback do not support binlog format: STATEMENT
diff --git a/mysql-test/suite/binlog/r/max_binlog_total_size.result b/mysql-test/suite/binlog/r/max_binlog_total_size.result
new file mode 100644
index 00000000..93f83cf2
--- /dev/null
+++ b/mysql-test/suite/binlog/r/max_binlog_total_size.result
@@ -0,0 +1,123 @@
+select @@global.max_binlog_total_size;
+@@global.max_binlog_total_size
+1500
+select @@global.max_binlog_size;
+@@global.max_binlog_size
+4096
+#
+# MDEV-31404 Implement binlog_space_limit
+#
+FLUSH LOGS;
+FLUSH LOGS;
+FLUSH LOGS;
+show binary logs;
+Log_name File_size
+binary.000001 #
+binary.000002 #
+binary.000003 #
+binary.000004 #
+show status like "binlog_disk_use";
+Variable_name Value
+Binlog_disk_use 1552
+set @@global.slave_connections_needed_for_purge= 0;
+# binary.000001 should be deleted now
+show binary logs;
+Log_name File_size
+binary.000002 #
+binary.000003 #
+binary.000004 #
+show status like "binlog_disk_use";
+Variable_name Value
+Binlog_disk_use 1183
+CREATE TABLE `t1` (
+`v1` int(11) DEFAULT NULL,
+`v2` varchar(8000) DEFAULT NULL,
+KEY `v1` (`v1`)
+) engine=myisam;
+INSERT INTO t1 VALUES (0,repeat("a",3000));
+show status like "binlog_disk_use";
+Variable_name Value
+Binlog_disk_use 3863
+# First binary should be binary.000004
+show binary logs;
+Log_name File_size
+binary.000004 #
+INSERT INTO t1 VALUES (2,repeat("b",10));
+# First binary should be binary.000004
+show binary logs;
+Log_name File_size
+binary.000004 #
+binary.000005 #
+FLUSH LOGS;
+# First binary should be binary.000005
+show binary logs;
+Log_name File_size
+binary.000005 #
+binary.000006 #
+FLUSH LOGS;
+FLUSH LOGS;
+FLUSH LOGS;
+FLUSH LOGS;
+show binary logs;
+Log_name File_size
+binary.000008 #
+binary.000009 #
+binary.000010 #
+show status like "binlog_disk_use";
+Variable_name Value
+Binlog_disk_use 1225
+PURGE BINARY LOGS TO 'binary.000009';
+# First binary should be binary.000009
+show binary logs;
+Log_name File_size
+binary.000009 #
+binary.000010 #
+INSERT INTO t1 VALUES (3,repeat("c",4000));
+# First binary should be binary.000010
+show binary logs;
+Log_name File_size
+binary.000010 #
+binary.000011 #
+INSERT INTO t1 VALUES (4,repeat("d",3000));
+# First binary should be binary.000011
+show binary logs;
+Log_name File_size
+binary.000011 #
+RESET MASTER;
+show binary logs;
+Log_name File_size
+binary.000001 #
+show status like "binlog_disk_use";
+Variable_name Value
+Binlog_disk_use 325
+INSERT INTO t1 VALUES (5,"e");
+FLUSH LOGS;
+INSERT INTO t1 VALUES (6,repeat("f",3000));
+show binary logs;
+Log_name File_size
+binary.000002 #
+show status like "binlog_disk_use";
+Variable_name Value
+Binlog_disk_use 3647
+INSERT INTO t1 VALUES (7,repeat("g",3000));
+# binary.000001 should be deleted now
+show binary logs;
+Log_name File_size
+binary.000002 #
+binary.000003 #
+show status like "binlog_disk_use";
+Variable_name Value
+Binlog_disk_use 7338
+FLUSH LOGS;
+FLUSH LOGS;
+# binary.000002 should be deleted now
+show binary logs;
+Log_name File_size
+binary.000003 423
+binary.000004 423
+binary.000005 379
+show status like "binlog_disk_use";
+Variable_name Value
+Binlog_disk_use 1225
+DROP TABLE IF EXISTS t1;
+set @@global.slave_connections_needed_for_purge= default;