mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-6163: Error while executing an update query that has the same table in a sub-query
We have to run the derived table prepare before the unique table check to mark the derived table (in this case the unique table check can turn that table to materialized one).
This commit is contained in:
@ -1017,6 +1017,13 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list,
|
||||
|
||||
thd->lex->allow_sum_func= 0;
|
||||
|
||||
/*
|
||||
We do not call DT_MERGE_FOR_INSERT because it has no sense for simple
|
||||
(not multi-) update
|
||||
*/
|
||||
if (mysql_handle_derived(thd->lex, DT_PREPARE))
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
if (setup_tables_and_check_access(thd, &select_lex->context,
|
||||
&select_lex->top_join_list,
|
||||
table_list,
|
||||
|
Reference in New Issue
Block a user