summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorunknown <sanja@askmonty.org>2014-05-08 22:56:36 +0300
committerunknown <sanja@askmonty.org>2014-05-08 22:56:36 +0300
commit45a91d8cbbfb38926f839b9c3cec73a39c5ebffd (patch)
tree38d2449ef8c78990fed2349baa5be05497d327c9 /sql/sql_update.cc
parent3f80740aa8fb24a0f9798e7239f0adb9f910e0a6 (diff)
downloadmariadb-git-45a91d8cbbfb38926f839b9c3cec73a39c5ebffd.tar.gz
MDEV-6193: Problems with multi-table updates that JOIN against read-only table
All underlying tables should share the same lock type.
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index b60f21ca9d5..e785b1106cf 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -1300,11 +1300,11 @@ int mysql_multi_update_prepare(THD *thd)
be write-locked (for example, trigger to be invoked might try
to update this table).
*/
- tl->lock_type= read_lock_type_for_table(thd, lex, tl);
+ if (using_lock_tables)
+ tl->lock_type= read_lock_type_for_table(thd, lex, tl);
+ else
+ tl->set_lock_type(thd, read_lock_type_for_table(thd, lex, tl));
tl->updating= 0;
- /* Update TABLE::lock_type accordingly. */
- if (!tl->placeholder() && !using_lock_tables)
- tl->table->file->set_lock_type(tl->lock_type);
}
}
for (tl= table_list; tl; tl= tl->next_local)