summaryrefslogtreecommitdiff
path: root/sql/item_windowfunc.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2020-06-01 14:30:21 +0400
committerAlexander Barkov <bar@mariadb.com>2020-06-01 14:30:21 +0400
commit33b839b2e767775d2345caf73ff4eecd155f0518 (patch)
tree18a756b58418f26e7a05a8745344c946afa8c6a2 /sql/item_windowfunc.h
parentf22093ad392b6a7c9906ff97551fc9e1eda8ffa7 (diff)
downloadmariadb-git-33b839b2e767775d2345caf73ff4eecd155f0518.tar.gz
MDEV-20280 PERCENTILE_DISC() rejects temporal and string input
Diffstat (limited to 'sql/item_windowfunc.h')
-rw-r--r--sql/item_windowfunc.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h
index f38209e4bb5..c3304122c1b 100644
--- a/sql/item_windowfunc.h
+++ b/sql/item_windowfunc.h
@@ -779,12 +779,23 @@ public:
if (get_row_count() == 0 || get_arg(0)->is_null())
{
null_value= true;
- return 0;
+ return true;
}
null_value= false;
return value->get_date(thd, ltime, fuzzydate);
}
+ bool val_native(THD *thd, Native *to)
+ {
+ if (get_row_count() == 0 || get_arg(0)->is_null())
+ {
+ null_value= true;
+ return true;
+ }
+ null_value= false;
+ return value->val_native(thd, to);
+ }
+
bool add()
{
Item *arg= get_arg(0);