From e692b9e85c925ccaf1370e25c851a2cab4b3a0e3 Mon Sep 17 00:00:00 2001 From: Yoshinori Matsunobu Date: Wed, 14 Jan 2015 15:02:49 -0800 Subject: [PATCH] Wrong argument was passed to Apply_changes_iter::init() Summary: Apply_changes_iter::init() function takes "bool is_reverse_arg" as a first argument, but actually RDBSE_KEYDEF was passed from ha_rocksdb::setup_index_scan(). So is_reverse_arg was always true, and RocksDB SE did always reverse index scan, and it also broke Apply_changes_iter behavior. This diff passes correct variable (keydef->is_reverse_cf), and with this fix, I confirmed bug#19 fixed. Test Plan: mtr --suite=rocksdb, including rocksdb.transaction Reviewers: sergey.petrunya.9, hermanlee4, maykov, jonahcohen Reviewed By: jonahcohen Subscribers: jtolmer Differential Revision: https://reviews.facebook.net/D31551 --- storage/rocksdb/ha_rocksdb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 60a641c26eec..9e1b0b7cb69b 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -2889,7 +2889,7 @@ void ha_rocksdb::setup_index_scan(RDBSE_KEYDEF *keydef, options.snapshot= trx->snapshot; rocksdb::Iterator* rocksdb_it= rdb->NewIterator(options, keydef->get_cf()); scan_it= new Apply_changes_iter; - scan_it->init(keydef, &trx->changes, rocksdb_it); + scan_it->init(keydef->is_reverse_cf, &trx->changes, rocksdb_it); } /*