diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-01-14 21:23:00 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-01-15 00:12:16 +0100 |
commit | b948b5f7c64c6430d98dc31b7e9f71d990b40ec1 (patch) | |
tree | ed698c6932c229d85d85c9cde10cdd218fec64d9 /sql/item_func.cc | |
parent | 798fcb541698cbf51f1ee33f44b023c11dc2b784 (diff) | |
download | mariadb-git-b948b5f7c64c6430d98dc31b7e9f71d990b40ec1.tar.gz |
bugfix: Item_func_min_max stored thd internally
It was used for get_datetime_value() and for thd->is_error().
But in fact, get_datetime_value() never used thd argument, because the
cache ptr argument was NULL. And thd->is_error() check was not needed
at that place at all.
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 89d3cd9e32a..cfccd66ea8a 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2856,7 +2856,6 @@ 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++) @@ -2929,13 +2928,11 @@ bool Item_func_min_max::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { Item **arg= args + i; bool is_null; - longlong res= get_datetime_value(thd, &arg, 0, compare_as_dates, &is_null); + longlong res= get_datetime_value(0, &arg, 0, compare_as_dates, &is_null); /* Check if we need to stop (because of error or KILL) and stop the loop */ - if (thd->is_error() || args[i]->null_value) - { + if (args[i]->null_value) return (null_value= 1); - } if (i == 0 || (res < min_max ? cmp_sign : -cmp_sign) > 0) min_max= res; |