summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 389d9d5380c..fb55b7660cb 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1564,10 +1564,9 @@ String *Item_temporal_hybrid_func::val_str_ascii(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, &ltime->year, &ltime->month,
&ltime->day))