diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2014-12-16 15:33:13 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2014-12-16 15:33:13 +0400 |
commit | 357cb12d87aa9d6abcf345b7221cf58d01203cdf (patch) | |
tree | 7d1065d4a65e6cbb8223a36376e9f6495e14c19f /sql | |
parent | 5257d71e0e495216162b790efc6866027aa2b718 (diff) | |
download | mariadb-git-357cb12d87aa9d6abcf345b7221cf58d01203cdf.tar.gz |
DEV-7221 from_days fails after null value
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_timefunc.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 59a5f1849f8..522004e965b 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1488,10 +1488,9 @@ String *Item_temporal_func::val_str(String *str) bool Item_func_from_days::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { longlong value=args[0]->val_int(); - if (args[0]->null_value) - return (null_value= 1); - if ((fuzzy_date & TIME_NO_ZERO_DATE) && value == 0) - return (null_value= 1); + if ((null_value= (args[0]->null_value || + ((fuzzy_date & TIME_NO_ZERO_DATE) && value == 0)))) + return true; bzero(ltime, sizeof(MYSQL_TIME)); if (get_date_from_daynr((long) value, <ime->year, <ime->month, <ime->day)) |