Skip to content

Commit 0d8e7a0

Browse files
spetruniaGunnar Kudrjavets
authored andcommitted
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
1 parent 801810c commit 0d8e7a0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

storage/rocksdb/ha_rocksdb.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3271,8 +3271,14 @@ int ha_rocksdb::info(uint flag)
32713271
void ha_rocksdb::position(const uchar *record)
32723272
{
32733273
DBUG_ENTER("ha_rocksdb::position");
3274-
3275-
memcpy(ref, last_rowkey.ptr(), ref_length);
3274+
/*
3275+
Get packed primary key value from the record.
3276+
(Note: last_rowkey has the packed PK of last-read-row, which allows to
3277+
handle most cases, but there is an exception to this: when slave applies
3278+
RBR events, it fills the record and then calls position(); rnd_pos())
3279+
*/
3280+
pk_descr->pack_record(table, pack_buffer, record, ref,
3281+
NULL, NULL);
32763282
DBUG_VOID_RETURN;
32773283
}
32783284

0 commit comments

Comments
 (0)