summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorVarun Gupta <varun.gupta@mariadb.com>2018-12-19 18:57:14 +0530
committerVarun Gupta <varun.gupta@mariadb.com>2018-12-19 18:57:14 +0530
commit82a4d55d5c569a9adfbd863c928bd357c2e5afed (patch)
treee5c4521559a1639166012671dc4478204b69081c /sql/item_func.cc
parent0c2fc9b3da467132cba7fd3a9d92995c98057f06 (diff)
downloadmariadb-git-82a4d55d5c569a9adfbd863c928bd357c2e5afed.tar.gz
MDEV-15424: Unreasonable SQL Error (1356) on select from view
While printing a view containing a window function we were printing it as an Item_field object instead of an Item_window_func object. This is incorrect and this leads to us throwing an error ER_VIEW_INVALID. Fixed by adjusting the Item_ref:print function. Also made UDF function aware if there arguments have window function.
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 512c8fccab0..89ca25bbfd4 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -3484,6 +3484,8 @@ udf_handler::fix_fields(THD *thd, Item_func_or_sum *func,
if (item->maybe_null)
func->maybe_null=1;
func->with_sum_func= func->with_sum_func || item->with_sum_func;
+ func->with_window_func= func->with_window_func ||
+ item->with_window_func;
func->with_field= func->with_field || item->with_field;
func->with_param= func->with_param || item->with_param;
func->with_subselect|= item->with_subselect;