From 997c86c76c3a5e92f297b9740dbc9b6a65bb771d Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Sun, 30 Oct 2016 21:07:16 +0000 Subject: [PATCH] MariaRocks port: fix rocksdb.handler_basic test MySQL has each storage engine to increment Handler_XXX counters, while MariaDB has handler::ha_XXX() methods to do the increments. MariaDB's solution doesn't work for storage engines that implement handler::read_range_first(), though. Make ha_rocksdb::read_range_first increment the counter (when it is calling handler::ha_XXX() function that will) --- sql/handler.h | 8 +++++++- storage/rocksdb/ha_rocksdb.cc | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sql/handler.h b/sql/handler.h index 775d21ed3ff..dca052b0ac9 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -3928,10 +3928,16 @@ private: void mark_trx_read_write_internal(); bool check_table_binlog_row_based_internal(bool binlog_row); - /* Private helpers */ +protected: + /* + These are intended to be used only by handler::ha_xxxx() functions + However, engines that implement read_range_XXX() (like MariaRocks) + or embed other engines (like ha_partition) may need to call these also + */ inline void increment_statistics(ulong SSV::*offset) const; inline void decrement_statistics(ulong SSV::*offset) const; +private: /* Low-level primitives for storage engines. These should be overridden by the storage engine class. To call these methods, use diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 06609e4836a..fb43b8ce849 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -6265,6 +6265,7 @@ int ha_rocksdb::read_range_first(const key_range *start_key, DBUG_RETURN(HA_ERR_LOCK_DEADLOCK); } #endif + increment_statistics(&SSV::ha_read_key_count); MYSQL_TABLE_IO_WAIT(m_psi, PSI_TABLE_FETCH_ROW, active_index, 0, { result= index_read_map_impl(table->record[0],