mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fixed bug #21493: crash for the second execution of a function
containing a select statement that uses an aggregating IN subquery. Added a parameter to the function fix_prepare_information to restore correctly the having clause for the second execution. Saved andor structure of the having conditions at the proper moment before any calls of split_sum_func2 that could modify the having structure adding new Item_ref objects. (These additions, are produced not with the statement mem_root, but rather with the execution mem_root.)
This commit is contained in:
@ -342,6 +342,7 @@ cleanup:
|
||||
*/
|
||||
bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
|
||||
{
|
||||
Item *fake_conds= 0;
|
||||
SELECT_LEX *select_lex= &thd->lex->select_lex;
|
||||
DBUG_ENTER("mysql_prepare_delete");
|
||||
|
||||
@ -367,7 +368,7 @@ bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
}
|
||||
select_lex->fix_prepare_information(thd, conds);
|
||||
select_lex->fix_prepare_information(thd, conds, &fake_conds);
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user