diff --git a/mysql-test/suite/rocksdb/r/trx_info_rpl.result b/mysql-test/suite/rocksdb/r/trx_info_rpl.result index 5d8fa5c110cc..d689f1d58cb8 100644 --- a/mysql-test/suite/rocksdb/r/trx_info_rpl.result +++ b/mysql-test/suite/rocksdb/r/trx_info_rpl.result @@ -3,11 +3,17 @@ Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. [connection master] +[connection master] create table t1 (a int, b int, primary key (a), unique key (b)) engine=rocksdb; +[connection slave] show variables like 'rocksdb_rpl_skip_tx_api'; Variable_name Value rocksdb_rpl_skip_tx_api ON include/start_slave.inc found +[connection master] +delete from t1 where a = 1; +include/sync_slave_sql_with_master.inc +[connection master] DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-test/suite/rocksdb/t/trx_info_rpl.test b/mysql-test/suite/rocksdb/t/trx_info_rpl.test index d9f2f752e6c4..a151dc1f9f9b 100644 --- a/mysql-test/suite/rocksdb/t/trx_info_rpl.test +++ b/mysql-test/suite/rocksdb/t/trx_info_rpl.test @@ -4,8 +4,9 @@ --let rpl_skip_start_slave=1 --source include/master-slave.inc +--source include/count_sessions.inc -connection master; +--source include/rpl_connection_master.inc create table t1 (a int, b int, primary key (a), unique key (b)) engine=rocksdb; --disable_query_log --let $aa= 0 @@ -15,7 +16,7 @@ while ($aa < 1000) { } --enable_query_log -connection slave; +--source include/rpl_connection_slave.inc show variables like 'rocksdb_rpl_skip_tx_api'; --source include/start_slave.inc @@ -36,6 +37,13 @@ let $count= query_get_value(select count(*) as Value from information_schema.roc --inc $it } -connection master; +--source include/rpl_connection_master.inc +delete from t1 where a = 1; +--source include/sync_slave_sql_with_master.inc + + +--source include/rpl_connection_master.inc DROP TABLE t1; + --source include/rpl_end.inc +--source include/wait_until_count_sessions.inc diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index e3e006ae93bb..61aba7a6b975 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -4985,10 +4985,10 @@ class Rdb_writebatch_impl : public Rdb_transaction { rocksdb::ColumnFamilyHandle *const column_family = key_descr.get_cf(); if (value == nullptr) { - rocksdb::PinnableSlice pin_val; - rocksdb::Status s = get(column_family, key, &pin_val); - pin_val.Reset(); - return s; + // minic tranaction API get_for_update() behavior: + // if value isn't nullptr, get_for_update() will lock and fetch value + // if value is nullptr, get_for_update will only lock + return rocksdb::Status::OK(); } return get(column_family, key, value);