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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user