diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-06-13 11:56:56 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2018-06-13 11:56:56 +0400 |
commit | 2412c151916dc65660644a0cd2fe5f34816ea901 (patch) | |
tree | 887acf8786b498c06922e52c1a06a16ed7126135 /sql/item_windowfunc.cc | |
parent | ae0aefb1c522455b785c2e43636c482cd161e3de (diff) | |
download | mariadb-git-2412c151916dc65660644a0cd2fe5f34816ea901.tar.gz |
MDEV-15870 Using aggregate and window function in unexpected places can crash the server
Diffstat (limited to 'sql/item_windowfunc.cc')
-rw-r--r-- | sql/item_windowfunc.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item_windowfunc.cc b/sql/item_windowfunc.cc index 5fbfb2651af..52738bfab87 100644 --- a/sql/item_windowfunc.cc +++ b/sql/item_windowfunc.cc @@ -71,9 +71,9 @@ Item_window_func::fix_fields(THD *thd, Item **ref) { DBUG_ASSERT(fixed == 0); - enum_parsing_place place= thd->lex->current_select->context_analysis_place; - - if (!(place == SELECT_LIST || place == IN_ORDER_BY)) + if (!thd->lex->current_select || + (thd->lex->current_select->context_analysis_place != SELECT_LIST && + thd->lex->current_select->context_analysis_place != IN_ORDER_BY)) { my_error(ER_WRONG_PLACEMENT_OF_WINDOW_FUNCTION, MYF(0)); return true; |