summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-03-17 15:57:04 +0100
committerSergei Golubchik <sergii@pisem.net>2011-03-17 15:57:04 +0100
commitd72f05fc5b330c3507b44538d5e5559a2c70288a (patch)
tree02f974058ebd7d0afcb42367053b42d63984ccfe /sql/item_func.cc
parent1cda2654578b82da52c29a829d463955f8795cc9 (diff)
downloadmariadb-git-d72f05fc5b330c3507b44538d5e5559a2c70288a.tar.gz
lp:736791 Crash in make_truncated_value_warningwith LEAST()/GREATEST/COALESCE
and a test case for lp:736370 Datetime functions in subquery context cause wrong result
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index b37156efa02..821341aa82d 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -2221,6 +2221,7 @@ void Item_func_min_max::fix_length_and_dec()
decimals=0;
max_length=0;
maybe_null=0;
+ thd= current_thd;
cmp_type=args[0]->result_type();
for (uint i=0 ; i < arg_count ; i++)
@@ -2240,8 +2241,6 @@ void Item_func_min_max::fix_length_and_dec()
if (cmp_type == STRING_RESULT)
{
agg_arg_charsets(collation, args, arg_count, MY_COLL_CMP_CONV, 1);
- if (compare_as_dates)
- thd= current_thd;
}
else if ((cmp_type == DECIMAL_RESULT) || (cmp_type == INT_RESULT))
max_length= my_decimal_precision_to_length_no_truncation(max_int_part +