Commit 39d7e596 authored by Nikita Malyavin's avatar Nikita Malyavin Committed by Sergei Golubchik

MDEV-16252: MINIMAL binlog_row_image does not work for versioned tables

* mark columns for binlog before inserting history row

Closes #822
parent 8123d799
...@@ -164,4 +164,17 @@ update t1 set i = 0; ...@@ -164,4 +164,17 @@ update t1 set i = 0;
connection slave; connection slave;
connection master; connection master;
drop table t1; drop table t1;
# MDEV-16252: MINIMAL binlog_row_image does not work for versioned tables
set @old_row_image= @@binlog_row_image;
set binlog_row_image= minimal;
create or replace table t1 (pk int, i int, primary key(pk))
with system versioning;
insert into t1 values (1,10),(2,20);
update t1 set i = 0;
connection slave;
connection master;
drop table t1;
set binlog_row_image= @old_row_image;
drop database test;
create database test;
include/rpl_end.inc include/rpl_end.inc
...@@ -133,4 +133,21 @@ sync_slave_with_master; ...@@ -133,4 +133,21 @@ sync_slave_with_master;
connection master; connection master;
drop table t1; drop table t1;
--echo # MDEV-16252: MINIMAL binlog_row_image does not work for versioned tables
set @old_row_image= @@binlog_row_image;
set binlog_row_image= minimal;
create or replace table t1 (pk int, i int, primary key(pk))
with system versioning;
insert into t1 values (1,10),(2,20);
update t1 set i = 0;
--sync_slave_with_master
--connection master
drop table t1;
set binlog_row_image= @old_row_image;
drop database test;
create database test;
--source include/rpl_end.inc --source include/rpl_end.inc
...@@ -956,6 +956,7 @@ int mysql_update(THD *thd, ...@@ -956,6 +956,7 @@ int mysql_update(THD *thd,
if (table->versioned(VERS_TIMESTAMP)) if (table->versioned(VERS_TIMESTAMP))
{ {
store_record(table, record[2]); store_record(table, record[2]);
table->mark_columns_per_binlog_row_image();
error= vers_insert_history_row(table); error= vers_insert_history_row(table);
restore_record(table, record[2]); restore_record(table, record[2]);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment