mariadb/storage/maria
unknown 28131daa26 Fix for BUG#35351 "Maria: R-tree index does not return all expected rows"
BitKeeper/triggers/post-commit:
  commits to Maria public list
mysql-test/r/maria-gis-rtree.result:
  result is good now, similar to MyISAM's (gis-rtree.result)
storage/maria/ma_rt_index.c:
  R-tree key-reading code used info->buff as a cache for the next key read,
  but between key read and next key read, there is record read, which
  uses info->buff too. In detail, during a SELECT:
  First key read: maria_rfirst() is called, which calls maria_rtree_find_first() which calls 
  maria_rtree_find_req() which comes here
          if (after_key < last)
          {
            // ! the list of keys is copied to info->buff
            // and info->buff is remembered in info->int_keypos
            info->int_keypos= info->buff;
            info->int_maxpos= info->buff + (last - after_key);
            memcpy(info->buff, after_key, last - after_key);
            info->keyread_buff_used= 0;
          }
  Then record read:
  _ma_read_block_record() (as well as some other functions of
  ma_blockrec.c) overwrites info->buff:
    if (!(buff= pagecache_read(share->pagecache,
                               &info->dfile, ma_recordpos_to_page(record_pos), 0,
                               info->buff, share->page_type,
                               PAGECACHE_LOCK_LEFT_UNLOCKED, 0)))
  So, this has the effect that the keys saved by maria_rtree_find_req() are now lost:
  info->int_keypos now contains a copy of a data page!
  Then maria_rnext_same() runs (to find second row), calls maria_rtree_find_next() which
  does:
    if (!info->keyread_buff_used)
    {
      uchar *key= info->int_keypos;
      while (key < info->int_maxpos)
      {
        if (!maria_rtree_key_cmp(keyinfo->seg,
                                 info->first_mbr_key, key,
                                 info->last_rkey_length, search_flag))
  
  i.e. maria_rtree_key_cmp() is doing comparisons on values it reads from the data page.
  Naturally this is bad and no row is found.
  Origin of the bug: MARIA_HA::keyread_buff is new in Maria.
  Solution: use keyread_buff instead of buff (like _ma_search_next() does),
  in R-tree code. Note that ma_blockrec.c functions also use keyread_buff
  but they all are write-functions, which should not be running close
  to next-key-read. Also note that some ma_rt_index.c functions still
  use info->buff, but they are about writes too.
  Thanks Monty for the idea.
2008-04-11 11:53:21 +02:00
..
unittest Store maximum transaction id into control file at clean shutdown. 2008-04-04 19:10:53 +02:00
CMakeLists.txt Build maria_dump_log under Windows. Enable maria_chk --zerofill-keep-lsn 2008-02-25 17:31:55 +01:00
file_formats.txt Fixed compiler warnings 2008-02-22 17:22:56 +02:00
ft_maria.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ha_maria.cc Store maximum transaction id into control file at clean shutdown. 2008-04-04 19:10:53 +02:00
ha_maria.h Merge of changes in MyISAM since December 16 -> April 1 2008-04-01 17:57:30 +03:00
lockman.c Merge bk-internal.mysql.com:/home/bk/mysql-maria 2008-02-21 02:51:51 +02:00
lockman.h solaris fixes 2007-12-18 23:22:55 +01:00
ma_bitmap.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_blockrec.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_blockrec.h Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_cache.c Fixed compiler warnings 2008-01-13 00:30:38 +02:00
ma_changed.c GPL license update (same change as was done for all files in 5.1). 2007-03-02 11:20:23 +01:00
ma_check.c Store maximum transaction id into control file at clean shutdown. 2008-04-04 19:10:53 +02:00
ma_check_standalone.h WL#3072 Maria recovery. 2007-10-03 18:10:32 +02:00
ma_checkpoint.c Store maximum transaction id into control file at clean shutdown. 2008-04-04 19:10:53 +02:00
ma_checkpoint.h WL#3071 Maria checkpoint, WL#3072 Maria recovery 2007-11-16 17:09:51 +01:00
ma_checksum.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_close.c UNDO of rows now puts back all part of the row on their original pages and positions 2007-12-30 22:40:03 +02:00
ma_commit.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_commit.h - WL#3239 "log CREATE TABLE in Maria" 2007-06-22 14:49:37 +02:00
ma_control_file.c WL#3072 - Maria recovery 2008-04-08 15:27:39 +02:00
ma_control_file.h Store maximum transaction id into control file at clean shutdown. 2008-04-04 19:10:53 +02:00
ma_create.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_dbug.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_delete.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_delete_all.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_delete_table.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_dynrec.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_extra.c WL#3072 - Maria Recovery 2008-01-17 23:59:32 +01:00
ma_ft_boolean_search.c Merge of changes in MyISAM since December 16 -> April 1 2008-04-01 17:57:30 +03:00
ma_ft_eval.c Fixes after review of guilhem of block record patch 2007-04-19 13:18:56 +03:00
ma_ft_eval.h GPL license update (same change as was done for all files in 5.1). 2007-03-02 11:20:23 +01:00
ma_ft_nlq_search.c Mac compiler warnings fixed. 2008-02-07 22:46:32 +02:00
ma_ft_parser.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_ft_stem.c GPL license update (same change as was done for all files in 5.1). 2007-03-02 11:20:23 +01:00
ma_ft_test1.c Fixes after review of guilhem of block record patch 2007-04-19 13:18:56 +03:00
ma_ft_test1.h GPL license update (same change as was done for all files in 5.1). 2007-03-02 11:20:23 +01:00
ma_ft_update.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_ftdefs.h Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_fulltext.h Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_info.c Fixed compiler warnings 2008-01-13 00:30:38 +02:00
ma_init.c Fixing the little bug that if a new version reads an old control file, 2008-04-07 18:59:20 +02:00
ma_key.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_key_recover.c WL#3072 - Maria recovery 2008-04-08 15:27:39 +02:00
ma_key_recover.h Fixed bug in restoring auto-increment value in case of duplicate key with insert or update 2008-01-31 03:06:04 +02:00
ma_keycache.c After merge fixes. Applied changes made in myisam manually to maria. 2007-10-04 20:33:42 +03:00
ma_locking.c Very small changes. 2008-03-10 18:55:33 +01:00
ma_loghandler.c Store maximum transaction id into control file at clean shutdown. 2008-04-04 19:10:53 +02:00
ma_loghandler.h Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_loghandler_lsn.h Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_open.c Merge of changes in MyISAM since December 16 -> April 1 2008-04-01 17:57:30 +03:00
ma_packrec.c Merge of changes in MyISAM since December 16 -> April 1 2008-04-01 17:57:30 +03:00
ma_page.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_pagecache.c Fixed statistic calculation. 2008-03-11 18:12:08 +02:00
ma_pagecache.h copyright and license info 2008-03-04 12:58:21 +01:00
ma_pagecaches.c copyright and license info 2008-03-04 12:58:21 +01:00
ma_pagecrc.c copyright and license info 2008-03-04 12:58:21 +01:00
ma_panic.c merge 2007-12-31 12:52:45 +01:00
ma_preload.c Fix for BUG#34089 "Maria crash on LOAD INDEX after FLUSH TABLES". 2008-03-04 12:47:02 +01:00
ma_range.c Added MARIA_SHARE *share to a lot of places to make code simpler 2007-12-10 02:32:00 +02:00
ma_recovery.c Fixing the little bug that if a new version reads an old control file, 2008-04-07 18:59:20 +02:00
ma_recovery.h UNDO of rows now puts back all part of the row on their original pages and positions 2007-12-30 22:40:03 +02:00
ma_recovery_util.c Fix for BUG#34114 "maria_chk reports false error when several tables on 2008-01-29 22:20:59 +01:00
ma_recovery_util.h WL#3072 - Maria Recovery 2008-01-17 23:59:32 +01:00
ma_rename.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_rfirst.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_rkey.c Added MARIA_SHARE *share to a lot of places to make code simpler 2007-12-10 02:32:00 +02:00
ma_rlast.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_rnext.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_rnext_same.c Merge of changes in MyISAM since December 16 -> April 1 2008-04-01 17:57:30 +03:00
ma_rprev.c Added MARIA_SHARE *share to a lot of places to make code simpler 2007-12-10 02:32:00 +02:00
ma_rrnd.c Fixes for bugs found by maria.test and event*tests: 2007-08-21 20:54:11 +03:00
ma_rsame.c Fixed problems with ma_test2 and mi_test2 on high-byte-first system 2008-02-21 02:45:02 +02:00
ma_rsamepos.c Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_rt_index.c Fix for BUG#35351 "Maria: R-tree index does not return all expected rows" 2008-04-11 11:53:21 +02:00
ma_rt_index.h Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_rt_key.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_rt_key.h Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_rt_mbr.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_rt_mbr.h Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_rt_split.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_rt_test.c Mac compiler warnings fixed. 2008-02-07 22:46:32 +02:00
ma_scan.c Fixed problems with ma_test2 and mi_test2 on high-byte-first system 2008-02-21 02:45:02 +02:00
ma_search.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_sort.c Merge of changes in MyISAM since December 16 -> April 1 2008-04-01 17:57:30 +03:00
ma_sp_defs.h Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
ma_sp_key.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_sp_test.c After merge fixes. Applied changes made in myisam manually to maria. 2007-10-04 20:33:42 +03:00
ma_static.c Support of moving logs in other directory then data root. 2008-01-26 23:03:23 +02:00
ma_statrec.c Merge of changes in MyISAM since December 16 -> April 1 2008-04-01 17:57:30 +03:00
ma_test1.c Store maximum transaction id into control file at clean shutdown. 2008-04-04 19:10:53 +02:00
ma_test2.c Store maximum transaction id into control file at clean shutdown. 2008-04-04 19:10:53 +02:00
ma_test3.c Windows fixes 2008-01-10 13:21:53 +01:00
ma_test_all.res Fixes for redo/undo logging of key pages 2007-11-20 17:42:16 +02:00
ma_test_all.sh New version of ma_test_all 2008-01-08 22:21:28 +02:00
ma_test_big.sh UNDO of rows now puts back all part of the row on their original pages and positions 2007-12-30 22:40:03 +02:00
ma_test_recovery New version of ma_test_recovery.pl 2008-02-20 18:42:12 +02:00
ma_unique.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
ma_update.c Fixed bug in restoring auto-increment value in case of duplicate key with insert or update 2008-01-31 03:06:04 +02:00
ma_write.c Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
Makefile.am copyright and license info 2008-03-04 12:58:21 +01:00
maria_chk.c Store maximum transaction id into control file at clean shutdown. 2008-04-04 19:10:53 +02:00
maria_def.h Injecting more "const" declarations into code which does not change 2008-04-03 15:40:25 +02:00
maria_ftdump.c Added error HA_ERR_FILE_TOO_SHORT to be used when files are shorter than expected (by my_read/my_pread) 2007-12-04 23:23:42 +02:00
maria_pack.c Merge of changes in MyISAM since December 16 -> April 1 2008-04-01 17:57:30 +03:00
maria_read_log.c Store maximum transaction id into control file at clean shutdown. 2008-04-04 19:10:53 +02:00
maria_rename.sh Added storage/maria (based on MyISAM). WL#3245 2006-04-11 16:45:10 +03:00
plug.in Minor changes. New description in SHOW ENGINES for Maria. 2008-01-31 23:17:50 +01:00
tablockman.c Windows fixes 2008-01-10 13:21:53 +01:00
tablockman.h solaris fixes 2007-12-18 23:22:55 +01:00
test_pack Added storage/maria (based on MyISAM). WL#3245 2006-04-11 16:45:10 +03:00
trnman.c Store maximum transaction id into control file at clean shutdown. 2008-04-04 19:10:53 +02:00
trnman.h Merged with mysql-5.1 main tree. 2007-07-02 20:45:15 +03:00
trnman_public.h Store maximum transaction id into control file at clean shutdown. 2008-04-04 19:10:53 +02:00