Commit 997c86c7 authored by Sergei Petrunia's avatar Sergei Petrunia

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)
parent 4462e77a
...@@ -3928,10 +3928,16 @@ class handler :public Sql_alloc ...@@ -3928,10 +3928,16 @@ class handler :public Sql_alloc
void mark_trx_read_write_internal(); void mark_trx_read_write_internal();
bool check_table_binlog_row_based_internal(bool binlog_row); 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 increment_statistics(ulong SSV::*offset) const;
inline void decrement_statistics(ulong SSV::*offset) const; inline void decrement_statistics(ulong SSV::*offset) const;
private:
/* /*
Low-level primitives for storage engines. These should be Low-level primitives for storage engines. These should be
overridden by the storage engine class. To call these methods, use overridden by the storage engine class. To call these methods, use
......
...@@ -6265,6 +6265,7 @@ int ha_rocksdb::read_range_first(const key_range *start_key, ...@@ -6265,6 +6265,7 @@ int ha_rocksdb::read_range_first(const key_range *start_key,
DBUG_RETURN(HA_ERR_LOCK_DEADLOCK); DBUG_RETURN(HA_ERR_LOCK_DEADLOCK);
} }
#endif #endif
increment_statistics(&SSV::ha_read_key_count);
MYSQL_TABLE_IO_WAIT(m_psi, PSI_TABLE_FETCH_ROW, active_index, 0, MYSQL_TABLE_IO_WAIT(m_psi, PSI_TABLE_FETCH_ROW, active_index, 0,
{ result= index_read_map_impl(table->record[0], { result= index_read_map_impl(table->record[0],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment