summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
authorsvoj@mysql.com/april.(none) <>2006-12-20 19:05:35 +0400
committersvoj@mysql.com/april.(none) <>2006-12-20 19:05:35 +0400
commit5ad9035605d0ae5294441a91d7f1269a73133b0c (patch)
treec11e97770dd6f5a74395241a416cb6c76d6744cb /sql/lock.cc
parentd2fa9fd192ea4e42210671bd0ca7735d4f970dc3 (diff)
downloadmariadb-git-5ad9035605d0ae5294441a91d7f1269a73133b0c.tar.gz
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 or updated wrong rows. Fixed by creating temporary table for self-joined multi update statement.
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index ab4a81034ba..3b2b2857f65 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -528,7 +528,7 @@ int mysql_lock_have_duplicate(THD *thd, TABLE *table, TABLE_LIST *tables)
for (; tables; tables= tables->next)
{
table2= tables->table;
- if (table2->tmp_table == TMP_TABLE)
+ if (table2->tmp_table == TMP_TABLE || table == table2)
continue;
/* All tables in list must be in lock. */