Skip to content

Commit 997c86c

Browse files
committed
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)
1 parent 4462e77 commit 997c86c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

sql/handler.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3928,10 +3928,16 @@ class handler :public Sql_alloc
39283928
void mark_trx_read_write_internal();
39293929
bool check_table_binlog_row_based_internal(bool binlog_row);
39303930

3931-
/* Private helpers */
3931+
protected:
3932+
/*
3933+
These are intended to be used only by handler::ha_xxxx() functions
3934+
However, engines that implement read_range_XXX() (like MariaRocks)
3935+
or embed other engines (like ha_partition) may need to call these also
3936+
*/
39323937
inline void increment_statistics(ulong SSV::*offset) const;
39333938
inline void decrement_statistics(ulong SSV::*offset) const;
39343939

3940+
private:
39353941
/*
39363942
Low-level primitives for storage engines. These should be
39373943
overridden by the storage engine class. To call these methods, use

storage/rocksdb/ha_rocksdb.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6265,6 +6265,7 @@ int ha_rocksdb::read_range_first(const key_range *start_key,
62656265
DBUG_RETURN(HA_ERR_LOCK_DEADLOCK);
62666266
}
62676267
#endif
6268+
increment_statistics(&SSV::ha_read_key_count);
62686269

62696270
MYSQL_TABLE_IO_WAIT(m_psi, PSI_TABLE_FETCH_ROW, active_index, 0,
62706271
{ result= index_read_map_impl(table->record[0],

0 commit comments

Comments
 (0)