List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:June 19 2006 9:05am
Subject:bk commit into 4.1 tree (svoj:1.2493) BUG#18036
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of svoj. When svoj 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.2493 06/06/19 14:05:14 svoj@stripped +3 -0
  BUG#18036 - update of table joined to self reports table as crashed
  Certain updates of table joined to self results in unexpected
  behavior.
  
  The problem was that record cache was mistakenly enabled for
  self-joined table updates. Normally record cache must be disabled
  for such updates.
  
  Fixed wrong condition in code that determines whether to use
  record cache for self-joined table updates.
  
  Only MyISAM tables were affected.

  sql/sql_update.cc
    1.154 06/06/19 14:05:10 svoj@stripped +1 -1
    Fixed wrong condition in code that determines whether to use
    record cache for self-joined table updates.

  mysql-test/t/myisam.test
    1.46 06/06/19 14:05:10 svoj@stripped +9 -0
    Test case for BUG#18036.

  mysql-test/r/myisam.result
    1.60 06/06/19 14:05:09 svoj@stripped +8 -0
    Test case for BUG#18036.

# 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:	svoj
# Host:	may.pils.ru
# Root:	/home/svoj/devel/mysql/BUG18036/mysql-4.1

--- 1.153/sql/sql_update.cc	2006-01-26 01:09:01 +04:00
+++ 1.154/sql/sql_update.cc	2006-06-19 14:05:10 +05:00
@@ -862,7 +862,7 @@ int multi_update::prepare(List<Item> &no
   for (table_ref= all_tables;  table_ref; table_ref=table_ref->next)
   {
     TABLE *table=table_ref->table;
-    if (!(tables_to_update & table->map) && 
+    if ((tables_to_update & table->map) && 
 	mysql_lock_have_duplicate(thd, table, update_tables))
       table->no_cache= 1;			// Disable row cache
   }

--- 1.59/mysql-test/r/myisam.result	2006-03-10 18:03:00 +04:00
+++ 1.60/mysql-test/r/myisam.result	2006-06-19 14:05:09 +05:00
@@ -748,3 +748,11 @@ select count(id1) from t1 where id2 = 10
 count(id1)
 5
 drop table t1;
+CREATE TABLE t1(a CHAR(9), b VARCHAR(7)) ENGINE=MyISAM;
+INSERT INTO t1(a) VALUES('xxxxxxxxx'),('xxxxxxxxx');
+UPDATE t1 AS ta1,t1 AS ta2 SET ta1.b='aaaaaa',ta2.b='bbbbbb';
+SELECT * FROM t1;
+a	b
+xxxxxxxxx	bbbbbb
+xxxxxxxxx	bbbbbb
+DROP TABLE t1;

--- 1.45/mysql-test/t/myisam.test	2006-03-10 18:03:00 +04:00
+++ 1.46/mysql-test/t/myisam.test	2006-06-19 14:05:10 +05:00
@@ -705,4 +705,13 @@ select count(*)   from t1 where id2 = 10
 select count(id1) from t1 where id2 = 10;
 drop table t1;
 
+#
+# BUG#18036 - update of table joined to self reports table as crashed
+#
+CREATE TABLE t1(a CHAR(9), b VARCHAR(7)) ENGINE=MyISAM;
+INSERT INTO t1(a) VALUES('xxxxxxxxx'),('xxxxxxxxx');
+UPDATE t1 AS ta1,t1 AS ta2 SET ta1.b='aaaaaa',ta2.b='bbbbbb';
+SELECT * FROM t1;
+DROP TABLE t1;
+
 # End of 4.1 tests
Thread
bk commit into 4.1 tree (svoj:1.2493) BUG#18036Sergey Vojtovich19 Jun