List:Internals« Previous MessageNext Message »
From:ramil Date:March 17 2005 7:24am
Subject:bk commit into 4.0 tree (ramil:1.2086) BUG#8942
View as plain text  
Below is the list of changes that have just been committed into a local
4.0 repository of ram. When ram 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
  1.2086 05/03/17 10:24:50 ramil@stripped +3 -0
  A fix (bug #8942: SUBSTRING_INDEX in UPDATE causes internal loop).

  sql/key.cc
    1.19 05/03/17 10:24:48 ramil@stripped +1 -1
    A fix (bug #8942: SUBSTRING_INDEX in UPDATE causes internal loop).
    For "partial" key parts (e.g. key(a(20), ...) we create different
    key_part->field, see sql/table.cc; so we have to use the eq() 
    function here to compare fields.

  mysql-test/t/update.test
    1.15 05/03/17 10:24:48 ramil@stripped +10 -0
    A fix (bug #8942: SUBSTRING_INDEX in UPDATE causes internal loop).

  mysql-test/r/update.result
    1.17 05/03/17 10:24:48 ramil@stripped +7 -0
    A fix (bug #8942: SUBSTRING_INDEX in UPDATE causes internal loop).

# 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:	ramil
# Host:	gw.mysql.r18.ru
# Root:	/usr/home/ram/work/4.0.b8942

--- 1.18/sql/key.cc	2004-01-20 02:44:37 +04:00
+++ 1.19/sql/key.cc	2005-03-17 10:24:48 +04:00
@@ -265,7 +265,7 @@
     f.rewind();
     while ((field=(Item_field*) f++))
     {
-      if (key_part->field == field->field)
+      if (key_part->field->eq(field->field))
 	return 1;
     }
   }

--- 1.16/mysql-test/r/update.result	2004-12-18 15:57:13 +04:00
+++ 1.17/mysql-test/r/update.result	2005-03-17 10:24:48 +04:00
@@ -209,3 +209,10 @@
 update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1";
 update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10;
 drop table t1, t2;
+create table t1 (a int, b char(255), key(a, b(20)));
+insert into t1 values (0, '1');
+update t1 set b = b + 1 where a = 0;
+select * from t1;
+a	b
+0	2
+drop table t1;

--- 1.14/mysql-test/t/update.test	2004-12-16 20:44:37 +04:00
+++ 1.15/mysql-test/t/update.test	2005-03-17 10:24:48 +04:00
@@ -164,3 +164,13 @@
 update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1";
 update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10;
 drop table t1, t2;
+
+#
+# Bug #8942: a problem with update and partial key part
+#
+
+create table t1 (a int, b char(255), key(a, b(20)));
+insert into t1 values (0, '1');
+update t1 set b = b + 1 where a = 0;
+select * from t1;
+drop table t1;
Thread
bk commit into 4.0 tree (ramil:1.2086) BUG#8942ramil17 Mar