1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-13170: Database service (MySQL) stops after update with trigger

For prepare statemtent/stored procedures we rollback the items to original
ones after prepare execution in the function reinit_stmt_before_use.
This rollback is done for group by, order by clauses but is not done for
the window specification containing the order by and partition by clause of the
window function.
This commit is contained in:
Varun Gupta
2018-11-16 10:39:08 +05:30
parent f74649b522
commit 705abdebaf
3 changed files with 87 additions and 0 deletions

View File

@ -2927,6 +2927,7 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
{
SELECT_LEX *sl= lex->all_selects_list;
DBUG_ENTER("reinit_stmt_before_use");
Window_spec *win_spec;
/*
We have to update "thd" pointer in LEX, all its units and in LEX::result,
@ -2995,6 +2996,17 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
/* Fix ORDER list */
for (order= sl->order_list.first; order; order= order->next)
order->item= &order->item_ptr;
/* Fix window functions too */
List_iterator<Window_spec> it(sl->window_specs);
while ((win_spec= it++))
{
for (order= win_spec->partition_list->first; order; order= order->next)
order->item= &order->item_ptr;
for (order= win_spec->order_list->first; order; order= order->next)
order->item= &order->item_ptr;
}
{
#ifndef DBUG_OFF
bool res=