mariadb/myisam
unknown fbe17c2a36 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).


include/my_base.h:
  Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX
  Changed the comment for HA_STATE_RNEXT_SAME as a warning
  for future uses.
myisam/mi_delete.c:
  Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX
  Removing the flag HA_STATE_RNEXT_SAME from info->update
  if info->lastkey2 was reused for another purpose than
  index scanning.
myisam/mi_key.c:
  Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX
  Removing the flag HA_STATE_RNEXT_SAME from info->update
  if info->lastkey2 was reused for another purpose than
  index scanning.
myisam/mi_rnext_same.c:
  Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX
  Removed trailing space and fixed a comment.
myisam/mi_unique.c:
  Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX
  Removing the flag HA_STATE_RNEXT_SAME from info->update
  if info->lastkey2 was reused for another purpose than
  index scanning.
myisam/mi_update.c:
  Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX
  Removing the flag HA_STATE_RNEXT_SAME from info->update
  if info->lastkey2 was reused for another purpose than
  index scanning.
myisam/mi_write.c:
  Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX
  Removing the flag HA_STATE_RNEXT_SAME from info->update
  if info->lastkey2 was reused for another purpose than
  index scanning.
mysql-test/r/myisam.result:
  Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX
  Added test result.
mysql-test/t/myisam.test:
  Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX
  Added test.
2006-03-10 15:03:04 +01:00
..
ftbench ftbench fixes 2003-10-23 23:33:06 +02:00
.cvsignore This ChangeSet adds RTREE support into myisam library. 2002-02-20 14:11:21 +04:00
ChangeLog New thr_alarm struct for better integration with OS2 2000-11-28 04:47:47 +02:00
ft_boolean_search.c Fixed compiler warnings 2005-07-28 21:25:05 +03:00
ft_eval.c Big code cleanup/review before 4.0.2 release. 2002-06-11 11:20:31 +03:00
ft_eval.h MI_KEYSEG -> HA_KEYSEG 2002-04-25 15:10:29 +05:00
ft_nlq_search.c Fix for BUG#13582. Theoretically possible to try to overallocate RAM in some fulltext queries. 2005-09-28 19:03:35 -05:00
ft_parser.c followup for for the bug#5686 2005-11-26 19:36:11 +01:00
ft_static.c indexless boolean fulltext search was depending on default_charset_info - Bug#8159 2005-02-04 15:24:06 +01:00
ft_stem.c Update copyright 2001-12-06 14:10:51 +02:00
ft_stopwords.c Fix for the bug #7344 (multiple server_init/server_end lead to crash) 2005-02-18 15:51:55 +04:00
ft_test1.c Merge with 4.0.3 2002-08-30 12:40:40 +03:00
ft_test1.h Update copyright 2001-12-06 14:10:51 +02:00
ft_update.c BUG#16489 - utf8 + fulltext leads to corrupt index file. 2006-01-23 17:15:33 +04:00
ftdefs.h indexless boolean fulltext search was depending on default_charset_info - Bug#8159 2005-02-04 15:24:06 +01:00
fulltext.h ft1->ft2 auto-conversion on INSERT (WL#725) 2003-10-02 20:22:29 +02:00
make-ccc Import changeset 2000-07-31 21:29:14 +02:00
Makefile.am Makefile.am: 2005-07-05 23:24:48 +02:00
mi_cache.c enadling out-of-cache reads for shared IO_CACHE 2003-01-26 14:20:43 +01:00
mi_changed.c Update copyright 2001-12-06 14:10:51 +02:00
mi_check.c Review of new pushed code 2005-11-01 13:00:02 +02:00
mi_checksum.c CLIENT_MULTI_QUERIES -> CLIENT_MULTI_STATEMENTS 2003-11-18 13:47:27 +02:00
mi_close.c Merge with 4.0 for 4.1 release 2004-10-06 19:14:33 +03:00
mi_create.c Fix for bug #10893 (myisamchk fails on packed spatial) 2005-07-23 20:04:15 +05:00
mi_dbug.c Merge mysql.com:/home/mydev/mysql-4.0-4000 2005-09-23 10:49:08 +02:00
mi_delete.c Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX 2006-03-10 15:03:04 +01:00
mi_delete_all.c Merge key cache structures to one 2003-11-20 22:06:25 +02:00
mi_delete_table.c Code cleanup 2004-01-19 23:51:17 +01:00
mi_dynrec.c don't check record's checksum in REPAIR 2005-04-11 20:04:50 +02:00
mi_extra.c Add test for madvise() being declared in C++ code, because it is not 2005-08-31 10:08:55 -07:00
mi_info.c myisam_data_pointer_size 2004-05-01 15:41:59 +02:00
mi_key.c Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX 2006-03-10 15:03:04 +01:00
mi_keycache.c mi_keycache.c: 2003-11-25 22:20:31 -08:00
mi_locking.c Merge mysql.com:/home/my/mysql-4.0 into mysql.com:/home/my/mysql-4.1 2004-10-07 12:51:32 +03:00
mi_log.c Code cleanup 2004-01-19 23:51:17 +01:00
mi_open.c Cleanup during review of new code 2005-06-21 18:18:58 +03:00
mi_packrec.c a fix (bug #4214: Table corruption with myisampack and large BLOB objects). 2005-09-05 16:31:42 +05:00
mi_page.c Code cleanup 2004-01-19 23:51:17 +01:00
mi_panic.c Merge key cache structures to one 2003-11-20 22:06:25 +02:00
mi_preload.c make LOAD INDEX to work 2005-02-12 00:05:13 +01:00
mi_range.c Merging 2004-05-27 16:32:49 +05:00
mi_rename.c Code cleanup 2004-01-19 23:51:17 +01:00
mi_rfirst.c Update copyright 2001-12-06 14:10:51 +02:00
mi_rkey.c Review of new code since last pull 2005-10-07 03:12:15 +03:00
mi_rlast.c Update copyright 2001-12-06 14:10:51 +02:00
mi_rnext.c Merging 2004-05-27 16:32:49 +05:00
mi_rnext_same.c Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX 2006-03-10 15:03:04 +01:00
mi_rprev.c Fixed many compiler warnings 2004-04-05 13:56:05 +03:00
mi_rrnd.c just tried to find all 'skipp' and replace it with 'skip'. 2004-02-02 20:25:39 +04:00
mi_rsame.c Update copyright 2001-12-06 14:10:51 +02:00
mi_rsamepos.c Update copyright 2001-12-06 14:10:51 +02:00
mi_scan.c Update copyright 2001-12-06 14:10:51 +02:00
mi_search.c Added more tests for new UPDATE ... ORDER BY ... LIMIT optimization 2005-10-25 02:27:40 +03:00
mi_static.c a fix (bug #4214: Table corruption with myisampack and large BLOB objects). 2005-09-05 16:31:42 +05:00
mi_statrec.c just tried to find all 'skipp' and replace it with 'skip'. 2004-02-02 20:25:39 +04:00
mi_test1.c Merge with 4.0 2004-09-01 04:12:09 +03:00
mi_test2.c Bug#12920 - key_read_requests counter appears to re-set 2005-09-14 13:18:16 +02:00
mi_test3.c harmless "buffer overflow" fixed 2004-11-24 11:01:54 +01:00
mi_test_all.res Cleaned up SSL documentation 2001-10-02 05:53:00 +03:00
mi_test_all.sh Add detection of in_addr_t 2003-08-28 06:08:17 +03:00
mi_unique.c Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX 2006-03-10 15:03:04 +01:00
mi_update.c Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX 2006-03-10 15:03:04 +01:00
mi_write.c Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX 2006-03-10 15:03:04 +01:00
myisam_ftdump.c myisam/myisam_ftdump.c 2005-03-09 12:59:20 +01:00
myisamchk.c Merge a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-4.0 2005-12-04 15:34:47 +02:00
myisamdef.h BUG#9622, stage 2, work together with fix for BUG#12232: 2005-10-21 06:29:17 +04:00
myisamlog.c Several fixes for Netware. 2005-08-24 22:03:34 +03:00
myisampack.c Merge a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-4.0 2005-12-04 15:34:47 +02:00
NEWS Import changeset 2000-07-31 21:29:14 +02:00
rt_index.c fixes/cleanups according to Coverity report 2005-01-24 15:48:25 +01:00
rt_index.h Merging 2004-06-02 19:17:35 +05:00
rt_key.c Merging 2004-06-02 19:17:35 +05:00
rt_key.h Merging 2004-06-02 19:17:35 +05:00
rt_mbr.c Fix compiler warnings (detected by Intel's C++ compiler) 2004-10-22 18:44:51 +03:00
rt_mbr.h Merging 2004-06-02 19:17:35 +05:00
rt_split.c Added some missing casts and changed a define for alloca(). 2005-07-20 13:27:57 +03:00
rt_test.c Review of all code pushed since last review 2004-10-20 01:28:42 +03:00
sort.c BUG#9622, stage 2, work together with fix for BUG#12232: 2005-10-21 06:29:17 +04:00
sp_defs.h WL#1163 To make spatial code optional 2004-03-12 18:51:03 +04:00
sp_key.c a fix (bug #10757: gis-rtree.test fails) 2005-05-20 18:48:18 +05:00
sp_test.c Merging 2004-05-27 16:32:49 +05:00
test_pack Import changeset 2000-07-31 21:29:14 +02:00
TODO Import changeset 2000-07-31 21:29:14 +02:00