summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/suite/versioning/r/rpl.result13
-rw-r--r--mysql-test/suite/versioning/t/rpl.test17
-rw-r--r--sql/sql_update.cc1
3 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/suite/versioning/r/rpl.result b/mysql-test/suite/versioning/r/rpl.result
index fd62a65f473..8db963f9ea4 100644
--- a/mysql-test/suite/versioning/r/rpl.result
+++ b/mysql-test/suite/versioning/r/rpl.result
@@ -164,4 +164,17 @@ update t1 set i = 0;
connection slave;
connection master;
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
diff --git a/mysql-test/suite/versioning/t/rpl.test b/mysql-test/suite/versioning/t/rpl.test
index e59d41c38a3..2549684da51 100644
--- a/mysql-test/suite/versioning/t/rpl.test
+++ b/mysql-test/suite/versioning/t/rpl.test
@@ -133,4 +133,21 @@ sync_slave_with_master;
connection master;
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
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 1d7dec31d56..5e5b6644377 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -956,6 +956,7 @@ update_begin:
if (table->versioned(VERS_TIMESTAMP))
{
store_record(table, record[2]);
+ table->mark_columns_per_binlog_row_image();
error= vers_insert_history_row(table);
restore_record(table, record[2]);
}