summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-04-19 21:04:44 +0400
committerAlexander Barkov <bar@mariadb.com>2019-04-19 21:04:44 +0400
commitf4b27400185bab217da11f8781eebb09a8502304 (patch)
tree820d0cf08d6946a8347927774d0ba852a3e0b619 /sql/item_func.cc
parent056b6fe1d59b515a6380e50783b3c4ad0f93959f (diff)
downloadmariadb-git-f4b27400185bab217da11f8781eebb09a8502304.tar.gz
MDEV-17299 Assertion `maybe_null' failed in make_sortkey
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 e995903b940..a1a2c3f1d1c 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -2794,6 +2794,8 @@ void Item_func_min_max::fix_length_and_dec()
switch (tmp_cmp_type) {
case TIME_RESULT:
// At least one temporal argument was found.
+ if (temporal_type_count < arg_count)
+ maybe_null= true; // Non-temporal-to-temporal conversion can return NULL
collation.set_numeric();
set_handler_by_field_type(temporal_field_type);
if (is_temporal_type_with_time(temporal_field_type))