From 46cdd39ea68ca4635983a16ecc1d88b5309e43ef Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Jun 2006 14:05:14 +0500 Subject: 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. mysql-test/r/myisam.result: Test case for BUG#18036. mysql-test/t/myisam.test: Test case for BUG#18036. sql/sql_update.cc: Fixed wrong condition in code that determines whether to use record cache for self-joined table updates. --- sql/sql_update.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 48a8cf93917..16423b39786 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -862,7 +862,7 @@ int multi_update::prepare(List ¬_used_values, 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 } -- cgit v1.2.1