1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-29741 SHOW BINLOG EVENTS shows garbage with system_versioning_insert_history=on

This commit is contained in:
Sergei Golubchik
2022-10-10 20:24:39 +02:00
parent a858ff1731
commit 4d1e3671d3
3 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
#
# MDEV-29741 SHOW BINLOG EVENTS shows garbage with system_versioning_insert_history=on
#
reset master;
create table t (a int) with system versioning;
set system_versioning_insert_history= on;
insert into t (a) values (1);
set system_versioning_insert_history= off;
drop table t;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; create table t (a int) with system versioning
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; set @@system_versioning_insert_history=1; insert into t (a) values (1)
master-bin.000001 # Query # # set @@system_versioning_insert_history=1; COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t` /* generated by server */

View File

@@ -0,0 +1,13 @@
--source include/have_log_bin.inc
--echo #
--echo # MDEV-29741 SHOW BINLOG EVENTS shows garbage with system_versioning_insert_history=on
--echo #
reset master;
create table t (a int) with system versioning;
set system_versioning_insert_history= on;
insert into t (a) values (1);
set system_versioning_insert_history= off;
drop table t;
source include/show_binlog_events.inc;

View File

@@ -1056,6 +1056,8 @@ void Query_log_event::pack_info(Protocol *protocol)
buf.append(STRING_WITH_LEN("check_constraint_checks=1, "));
if (flags2 & OPTION_IF_EXISTS)
buf.append(STRING_WITH_LEN("@@sql_if_exists=1, "));
if (flags2 & OPTION_INSERT_HISTORY)
buf.append(STRING_WITH_LEN("@@system_versioning_insert_history=1, "));
buf[buf.length()-2]=';';
}
if (query && q_len)