summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoringo@mysql.com <>2006-03-10 15:03:04 +0100
committeringo@mysql.com <>2006-03-10 15:03:04 +0100
commitd0c6eb885d7bb3a78bd2261372d7f41164636d40 (patch)
tree801bfa5ba08dc20436d5731d021e7d7e7cf2f4e5 /include
parente75a62aeaee8d429d7e725bf8f2ac7399dc3cd8b (diff)
downloadmariadb-git-d0c6eb885d7bb3a78bd2261372d7f41164636d40.tar.gz
Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX
For "count(*) while index_column = value" an index read is done. It consists of an index scan and retrieval of each key. For efficiency reasons the index scan stores the key in the special buffer 'lastkey2' once only. At the first iteration it notes this fact with the flag HA_STATE_RNEXT_SAME in 'info->update'. For efficiency reasons, the key retrieval for blobs does not allocate a new buffer, but uses 'lastkey2'... Now I clear the HA_STATE_RNEXT_SAME flag whenever the buffer has been polluted. In this case, the index scan copies the key value again (and sets the flag again).
Diffstat (limited to 'include')
-rw-r--r--include/my_base.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/my_base.h b/include/my_base.h
index 271e7cd23ba..1261a95175f 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -340,7 +340,7 @@ enum ha_base_keytype {
#define HA_STATE_BUFF_SAVED 512 /* If current keybuff is info->buff */
#define HA_STATE_ROW_CHANGED 1024 /* To invalide ROW cache */
#define HA_STATE_EXTEND_BLOCK 2048
-#define HA_STATE_RNEXT_SAME 4096 /* rnext_same was called */
+#define HA_STATE_RNEXT_SAME 4096 /* rnext_same occupied lastkey2 */
enum en_fieldtype {
FIELD_LAST=-1,FIELD_NORMAL,FIELD_SKIP_ENDSPACE,FIELD_SKIP_PRESPACE,