From b807f9f82a470df043aa3d5797cb3d58b8f6bafe Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Thu, 22 Jan 2015 16:44:26 +0100 Subject: [PATCH] Fix issue #18: slave crash on update with row based binary logging Summary: ha_rocksdb::position() should not return rowid of the last read row, it should get the rowid of the record passed as parameter. Test Plan: ./mtr --suite=rocksdb && ./mtr t/rocksdb*test Reviewers: yoshinorim Reviewed By: yoshinorim Subscribers: hermanlee4, maykov, jonahcohen Differential Revision: https://reviews.facebook.net/D31983 --- .../suite/rocksdb/rpl_row_rocksdb.result | 15 +++++++++++++++ mysql-test/suite/rocksdb/rpl_row_rocksdb.test | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/mysql-test/suite/rocksdb/rpl_row_rocksdb.result b/mysql-test/suite/rocksdb/rpl_row_rocksdb.result index 6f304147432c..40763b63a7a5 100644 --- a/mysql-test/suite/rocksdb/rpl_row_rocksdb.result +++ b/mysql-test/suite/rocksdb/rpl_row_rocksdb.result @@ -16,4 +16,19 @@ pk 2 3 drop table t1; +# +# Issue #18: slave crash on update with row based binary logging +# +create table t1 (id int primary key, value int, value2 int, index(value)) engine=rocksdb; +insert into t1 values (1,1,1); +insert into t1 values (2,1,1); +insert into t1 values (3,1,1); +insert into t1 values (4,1,1); +insert into t1 values (5,1,1); +update t1 set value2=100 where id=1; +include/sync_slave_sql_with_master.inc +select * from t1 where id=1; +id value value2 +1 1 100 +drop table t1; include/rpl_end.inc diff --git a/mysql-test/suite/rocksdb/rpl_row_rocksdb.test b/mysql-test/suite/rocksdb/rpl_row_rocksdb.test index 2ec9a08ed8f3..bb0572e22786 100644 --- a/mysql-test/suite/rocksdb/rpl_row_rocksdb.test +++ b/mysql-test/suite/rocksdb/rpl_row_rocksdb.test @@ -19,5 +19,23 @@ select * from t1; connection master; drop table t1; +--echo # +--echo # Issue #18: slave crash on update with row based binary logging +--echo # +create table t1 (id int primary key, value int, value2 int, index(value)) engine=rocksdb; +insert into t1 values (1,1,1); +insert into t1 values (2,1,1); +insert into t1 values (3,1,1); +insert into t1 values (4,1,1); +insert into t1 values (5,1,1); +update t1 set value2=100 where id=1; + +--source include/sync_slave_sql_with_master.inc +connection slave; +select * from t1 where id=1; + +connection master; +drop table t1; + --source include/rpl_end.inc