List:Commits« Previous MessageNext Message »
From:ingo Date:March 19 2007 3:56pm
Subject:bk commit into 4.1 tree (istruewing:1.2608) BUG#26996
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of istruewing. When istruewing does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-03-19 15:56:53+01:00, istruewing@stripped +3 -0
  Bug#26996 - Update of a Field in a Memory Table ends with wrong result
  
  Using a MEMORY table BTREE index for scanning for updatable rows
  could lead to an infinite loop.
  
  Everytime a key was inserted into a btree index, the position
  in the index scan was cleared. The search started from the
  beginning and found the same key again.
  
  Now we do not clear the position on key insert an more.

  heap/hp_write.c@stripped, 2007-03-19 15:56:51+01:00, istruewing@stripped +0 -1
    Bug#26996 - Update of a Field in a Memory Table ends with wrong result
    Removed the index-scan-breaking nulling of last_pos.
    The comment behind this line ("For heap_rnext/heap_rprev")
    was misleading. It should have been "Breaks heap_rnext/heap_rprev".

  mysql-test/r/heap_btree.result@stripped, 2007-03-19 15:56:51+01:00, istruewing@stripped
+15 -0
    Bug#26996 - Update of a Field in a Memory Table ends with wrong result
    Added test result.

  mysql-test/t/heap_btree.test@stripped, 2007-03-19 15:56:51+01:00, istruewing@stripped
+14 -0
    Bug#26996 - Update of a Field in a Memory Table ends with wrong result
    Added test.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	istruewing
# Host:	chilla.local
# Root:	/home/mydev/mysql-4.1-bug26996

--- 1.21/heap/hp_write.c	2007-03-19 15:56:57 +01:00
+++ 1.22/heap/hp_write.c	2007-03-19 15:56:57 +01:00
@@ -106,7 +106,6 @@ int hp_rb_write_key(HP_INFO *info, HP_KE
   heap_rb_param custom_arg;
   uint old_allocated;
 
-  info->last_pos= NULL; /* For heap_rnext/heap_rprev */
   custom_arg.keyseg= keyinfo->seg;
   custom_arg.key_length= hp_rb_make_key(keyinfo, info->recbuf, record, recpos);
   if (keyinfo->flag & HA_NOSAME)

--- 1.19/mysql-test/r/heap_btree.result	2007-03-19 15:56:57 +01:00
+++ 1.20/mysql-test/r/heap_btree.result	2007-03-19 15:56:57 +01:00
@@ -280,4 +280,19 @@ a
 1
 1
 drop table t1;
+CREATE TABLE t1 (
+c1 CHAR(3),
+c2 INTEGER,
+KEY USING BTREE(c1),
+KEY USING BTREE(c2)
+) ENGINE= MEMORY;
+INSERT INTO t1 VALUES ('ABC',0), ('A',0), ('B',0), ('C',0);
+UPDATE t1 SET c2= c2 + 1 WHERE c1 = 'A';
+SELECT * FROM t1;
+c1	c2
+ABC	0
+A	1
+B	0
+C	0
+DROP TABLE t1;
 End of 4.1 tests

--- 1.15/mysql-test/t/heap_btree.test	2007-03-19 15:56:57 +01:00
+++ 1.16/mysql-test/t/heap_btree.test	2007-03-19 15:56:57 +01:00
@@ -182,4 +182,18 @@ delete from t1 where a >= 2;
 select a from t1 order by a;
 drop table t1;
 
+#
+# Bug#26996 - Update of a Field in a Memory Table ends with wrong result
+#
+CREATE TABLE t1 (
+  c1 CHAR(3),
+  c2 INTEGER,
+  KEY USING BTREE(c1),
+  KEY USING BTREE(c2)
+) ENGINE= MEMORY;
+INSERT INTO t1 VALUES ('ABC',0), ('A',0), ('B',0), ('C',0);
+UPDATE t1 SET c2= c2 + 1 WHERE c1 = 'A';
+SELECT * FROM t1;
+DROP TABLE t1;
+
 --echo End of 4.1 tests
Thread
bk commit into 4.1 tree (istruewing:1.2608) BUG#26996ingo19 Mar