summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorunknown <svoj@may.pils.ru>2006-06-19 14:05:14 +0500
committerunknown <svoj@may.pils.ru>2006-06-19 14:05:14 +0500
commit46cdd39ea68ca4635983a16ecc1d88b5309e43ef (patch)
tree833750e7295c7b3452ff970cf85a822ba0595a03 /sql/sql_update.cc
parent3cbf2eafbfd1f7721d85282531ce3378b07d27ba (diff)
downloadmariadb-git-46cdd39ea68ca4635983a16ecc1d88b5309e43ef.tar.gz
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.
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc2
1 files changed, 1 insertions, 1 deletions
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<Item> &not_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
}