mariadb/heap
unknown cf5762b402 BUG#30590 - delete from memory table with composite btree primary key
DELETE query against memory table with btree index may remove
not all matching rows. This happens only when DELETE uses
index read method to find matching rows. E.g. for queries
like DELETE FROM t1 WHERE a=1.

Fixed by reverting fix for BUG9719 and applying proper solution.


heap/hp_delete.c:
  Reverted fix for BUG9719 as it makes queries like
  DELETE FROM t1 WHERE a=1 to remove not all matching
  rows (assuming this is memory table and there is btree
  key over `a`).
  
  This happens because we calculate info->lastkey_len in
  heap_rkey(). When we enter heap_rnext(), info->lastkey_len
  is 0 (set by hp_rb_delete_key()). We need to preserve
  info->lastkey_len in this situation, otherwise
  tree_search_key() will always return smallest value in
  a tree.
heap/hp_rfirst.c:
  If we're performing index_first on a table that was taken from
  table cache, info->lastkey_len is initialized to previous query.
  Thus we set info->lastkey_len to proper value for subsequent
  heap_rnext() calls.
  This is needed for DELETE queries only, otherwise this variable is
  not used.
  Note that the same workaround may be needed for heap_rlast(), but
  for now heap_rlast() is never used for DELETE queries.
heap/hp_rnext.c:
  An optimization for DELETE queries that use index_first()/index_next().
  Use faster tree_search_edge() instead of tree_search_key().
mysql-test/r/heap_btree.result:
  A test case for BUG#30590.
mysql-test/t/heap_btree.test:
  A test case for BUG#30590.
2007-09-13 15:39:16 +05:00
..
.cvsignore Import changeset 2000-07-31 21:29:14 +02:00
_check.c Added more tests for new UPDATE ... ORDER BY ... LIMIT optimization 2005-10-25 02:27:40 +03:00
_rectest.c RB-Tree indexes support in HEAP tables 2002-04-25 13:36:55 +05:00
ChangeLog Import changeset 2000-07-31 21:29:14 +02:00
heapdef.h WL#1687 - Optimize UNION DISTINCT ... UNION ALL (again). 2004-05-06 15:53:01 +02:00
hp_block.c Merge moonlight.home:/home/tomash/src/mysql_ab/mysql-4.0-bug23443 2007-01-09 12:39:05 +03:00
hp_clear.c Fix for bug#5138: hash indexes on heap tables support statistics. 2004-09-08 02:07:53 +04:00
hp_close.c RB-Tree indexes support in HEAP tables 2002-04-25 13:36:55 +05:00
hp_create.c Bug #12796: Record lost in HEAP table 2005-11-08 00:26:37 -05:00
hp_delete.c BUG#30590 - delete from memory table with composite btree primary key 2007-09-13 15:39:16 +05:00
hp_extra.c WL#1648 - Start/Stop Inserting Duplicates Into a Table 2004-03-18 16:47:16 +01:00
hp_hash.c Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1 2004-11-16 21:36:31 +03:00
hp_info.c After merge fixes 2004-02-16 10:03:25 +02:00
hp_open.c A fix (bug #6878: Crash with engine=memory). 2004-12-02 14:34:53 +04:00
hp_panic.c RB-Tree indexes support in HEAP tables 2002-04-25 13:36:55 +05:00
hp_rename.c RB-Tree indexes support in HEAP tables 2002-04-25 13:36:55 +05:00
hp_rfirst.c BUG#30590 - delete from memory table with composite btree primary key 2007-09-13 15:39:16 +05:00
hp_rkey.c Bugfix for HEAP table rb-index scan. 2003-06-10 12:19:28 +05:00
hp_rlast.c Stupid bug has been fixed 2002-07-12 13:12:32 +05:00
hp_rnext.c BUG#30590 - delete from memory table with composite btree primary key 2007-09-13 15:39:16 +05:00
hp_rprev.c Heap table code cleanup 2002-05-23 19:26:16 +05:00
hp_rrnd.c RB-Tree indexes support in HEAP tables 2002-04-25 13:36:55 +05:00
hp_rsame.c RB-Tree indexes support in HEAP tables 2002-04-25 13:36:55 +05:00
hp_scan.c Merge with 4.0.6 2002-12-05 19:38:42 +02:00
hp_static.c Update copyright 2001-12-06 14:10:51 +02:00
hp_test1.c Don't read ~/.my.cnf in mysqldump.test 2006-06-30 04:10:27 +03:00
hp_test2.c Fixed include file usage 2006-06-30 02:25:35 +03:00
hp_update.c Merge with 4.0.6 2002-12-05 19:38:42 +02:00
hp_write.c Bug#26996 - Update of a Field in a Memory Table ends with wrong result 2007-03-19 15:56:53 +01: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