From: Date: October 27 2006 7:23pm Subject: bk commit into 4.1 tree (svoj:1.2534) BUG#18036 List-Archive: http://lists.mysql.com/commits/14499 X-Bug: 18036 Message-Id: <20061027172314.58C8AB28@april.pils.ru> 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@stripped, 2006-10-27 22:23:10+05:00, svoj@stripped +3 -0 BUG#21310 - Trees in SQL causing a "crashed" table with MyISAM storage engine An update that used a join of a table to itself and modified the table on one side of the join reported the table as crashed. This problem was introduced with fix for BUG#18036. Do not rely on (tables_to_update & table->map) while determining whether to use record cache for self-joined table updates. It must be disabled for both: table that is opened for reading and table that is opened for writing. mysql-test/r/myisam.result@stripped, 2006-10-27 22:01:52+05:00, svoj@stripped +8 -0 A test case for BUG#21310. mysql-test/t/myisam.test@stripped, 2006-10-27 22:01:09+05:00, svoj@stripped +10 -0 A test case for BUG#21310. sql/sql_update.cc@stripped, 2006-10-27 22:03:45+05:00, svoj@stripped +1 -2 Do not rely on (tables_to_update & table->map) while determining whether to use record cache for self-joined table updates. It must be disabled for both: table that is opened for reading and table that is opened for writing. # 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: april.(none) # Root: /home/svoj/devel/mysql/BUG21310/mysql-4.1-engines --- 1.157/sql/sql_update.cc 2006-10-27 22:23:14 +05:00 +++ 1.158/sql/sql_update.cc 2006-10-27 22:23:14 +05:00 @@ -862,8 +862,7 @@ int multi_update::prepare(List &no for (table_ref= all_tables; table_ref; table_ref=table_ref->next) { TABLE *table=table_ref->table; - if ((tables_to_update & table->map) && - mysql_lock_have_duplicate(thd, table, update_tables)) + if (mysql_lock_have_duplicate(thd, table, update_tables)) table->no_cache= 1; // Disable row cache } DBUG_RETURN(thd->is_fatal_error != 0); --- 1.68/mysql-test/r/myisam.result 2006-10-27 22:23:14 +05:00 +++ 1.69/mysql-test/r/myisam.result 2006-10-27 22:23:14 +05:00 @@ -944,3 +944,11 @@ select * from t1; a 42 drop table t1; +CREATE TABLE t1(a VARCHAR(16)); +INSERT INTO t1 VALUES('aaaaaaaa'),(NULL); +UPDATE t1 AS ta1, t1 AS ta2 SET ta1.a='aaaaaaaaaaaaaaaa'; +SELECT * FROM t1; +a +aaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaa +DROP TABLE t1; --- 1.54/mysql-test/t/myisam.test 2006-10-27 22:23:14 +05:00 +++ 1.55/mysql-test/t/myisam.test 2006-10-27 22:23:14 +05:00 @@ -890,4 +890,14 @@ connection default; select * from t1; drop table t1; +# +# BUG#21310 - Trees in SQL causing a "crashed" table with MyISAM storage +# engine +# +CREATE TABLE t1(a VARCHAR(16)); +INSERT INTO t1 VALUES('aaaaaaaa'),(NULL); +UPDATE t1 AS ta1, t1 AS ta2 SET ta1.a='aaaaaaaaaaaaaaaa'; +SELECT * FROM t1; +DROP TABLE t1; + # End of 4.1 tests