diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-19 18:45:53 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-19 18:45:53 +0200 |
commit | fd58bb71e22196c3c5e8d20b92bce6f343f1dea1 (patch) | |
tree | 88b34c77a20d9e816edce51e9dcff47f6de526c8 /sql/sql_prepare.cc | |
parent | 37d6d3b661315617953f1a8c5d53a2cb6558992e (diff) | |
parent | e669e705a1a7d2bbdd42734cb9fc8349a5f2f118 (diff) | |
download | mariadb-git-fd58bb71e22196c3c5e8d20b92bce6f343f1dea1.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r-- | sql/sql_prepare.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 5324b2dd305..2bbbd5054c8 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2913,6 +2913,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, @@ -2981,6 +2982,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; + } + { #ifdef DBUG_ASSERT_EXISTS bool res= |