summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2015-01-26 22:54:27 -0500
committerNirbhay Choubey <nirbhay@mariadb.com>2015-01-26 22:54:27 -0500
commit7cda4bee0ef7c8a3ec85e94bc1443ceaba3a64e8 (patch)
treef8c1f556f36f026038015e7215ae88b0cb7b1ce5 /sql/item_timefunc.cc
parentea229eb6bb29ee7b11a7d28a7d4c80a593cb1d3b (diff)
parentfb71449b10100e9a0f887b1585000fbfab294f3c (diff)
downloadmariadb-git-7cda4bee0ef7c8a3ec85e94bc1443ceaba3a64e8.tar.gz
maria-10.0.16 merge
bzr merge -r4588 maria/10.0
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))