Fix real keyread count for partitions

Sergei's commit ac6b3c4430 implemented handler status counters
compensation for underlying handlers like ha_partition.
`index_read_idx_map` is missing there, but it should have been fixed as
well (proof: ha_partition::index_read_idx_map never calls
ha_partition::index_read_map).

Note: all this compensation logic could be broken for subpartitions! (We
can experience double decrement)
This commit is contained in:
Nikita Malyavin 2019-11-19 18:52:41 +10:00 committed by Sergei Golubchik
parent e6af62189e
commit b9df4d2a35
2 changed files with 5 additions and 4 deletions

View file

@ -546,7 +546,7 @@ SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS
WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
VARIABLE_NAME VARIABLE_VALUE
HANDLER_COMMIT 1
HANDLER_READ_KEY 2
HANDLER_READ_KEY 1
HANDLER_TMP_WRITE 24
HANDLER_UPDATE 2
HANDLER_WRITE 2
@ -628,7 +628,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
VARIABLE_NAME VARIABLE_VALUE
HANDLER_COMMIT 4
HANDLER_DELETE 2
HANDLER_READ_KEY 3
HANDLER_READ_KEY 2
HANDLER_READ_NEXT 1
HANDLER_READ_RND_NEXT 112
HANDLER_ROLLBACK 1
@ -651,7 +651,7 @@ VARIABLE_NAME VARIABLE_VALUE
HANDLER_COMMIT 5
HANDLER_DELETE 2
HANDLER_READ_FIRST 1
HANDLER_READ_KEY 3
HANDLER_READ_KEY 2
HANDLER_READ_NEXT 4
HANDLER_READ_RND_NEXT 140
HANDLER_ROLLBACK 1
@ -671,7 +671,7 @@ VARIABLE_NAME VARIABLE_VALUE
HANDLER_COMMIT 5
HANDLER_DELETE 2
HANDLER_READ_FIRST 1
HANDLER_READ_KEY 3
HANDLER_READ_KEY 2
HANDLER_READ_NEXT 4
HANDLER_READ_RND_NEXT 168
HANDLER_ROLLBACK 1

View file

@ -5837,6 +5837,7 @@ int ha_partition::index_read_idx_map(uchar *buf, uint index,
{
int error= HA_ERR_KEY_NOT_FOUND;
DBUG_ENTER("ha_partition::index_read_idx_map");
decrement_statistics(&SSV::ha_read_key_count);
if (find_flag == HA_READ_KEY_EXACT)
{