mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed bug #27229: crash when a set function aggregated in outer
context was used as an argument of GROUP_CONCAT. Ensured correct setting of the depended_from field in references generated for set functions aggregated in outer selects. A wrong value of this field resulted in wrong maps returned by used_tables() for these references. Made sure that a temporary table field is added for any set function aggregated in outer context when creation of a temporary table is needed to execute the inner subquery.
This commit is contained in:
@ -2349,14 +2349,12 @@ bool mysql_insert_select_prepare(THD *thd)
|
||||
DBUG_ASSERT(select_lex->leaf_tables != 0);
|
||||
lex->leaf_tables_insert= select_lex->leaf_tables;
|
||||
/* skip all leaf tables belonged to view where we are insert */
|
||||
for (first_select_leaf_table= select_lex->leaf_tables->next_leaf,
|
||||
thd->leaf_count --;
|
||||
for (first_select_leaf_table= select_lex->leaf_tables->next_leaf;
|
||||
first_select_leaf_table &&
|
||||
first_select_leaf_table->belong_to_view &&
|
||||
first_select_leaf_table->belong_to_view ==
|
||||
lex->leaf_tables_insert->belong_to_view;
|
||||
first_select_leaf_table= first_select_leaf_table->next_leaf,
|
||||
thd->leaf_count --)
|
||||
first_select_leaf_table= first_select_leaf_table->next_leaf)
|
||||
{}
|
||||
select_lex->leaf_tables= first_select_leaf_table;
|
||||
DBUG_RETURN(FALSE);
|
||||
|
Reference in New Issue
Block a user