1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-6193: Problems with multi-table updates that JOIN against read-only table

All underlying tables should share the same lock type.
This commit is contained in:
unknown
2014-05-08 22:56:36 +03:00
parent 3f80740aa8
commit 45a91d8cbb
5 changed files with 46 additions and 5 deletions

View File

@@ -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)