diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-01-08 21:23:03 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-01-08 21:23:03 +0100 |
commit | b0ee31c89480519490537b89dca1e8cc65e2b73b (patch) | |
tree | ed4d62ba164ba63763704fc41007489910489fc8 /sql/item_timefunc.cc | |
parent | 6f26aac9409e3456798e58a4ee4306e43c7ebf7b (diff) | |
download | mariadb-git-b0ee31c89480519490537b89dca1e8cc65e2b73b.tar.gz |
MDEV-3942 FROM_DAYS(<timestamp column>) returns different result in MariaDB comparing to MySQL: NULL vs 0000-00-00
fixed a regression, introduced while fixing MDEV-456
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index eaddd39fa58..9f2f9b2950d 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1,5 +1,6 @@ /* Copyright (c) 2000, 2012, Oracle and/or its affiliates. + Copyright (c) 2010, 2013, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1386,13 +1387,10 @@ bool Item_func_from_days::get_date(MYSQL_TIME *ltime, uint fuzzy_date) if (get_date_from_daynr((long) value, <ime->year, <ime->month, <ime->day)) - return (null_value= 1); - - if ((fuzzy_date & TIME_NO_ZERO_DATE) && ltime->year == 0) - return (null_value= 1); + return 0; ltime->time_type= MYSQL_TIMESTAMP_DATE; - return (null_value= 0); + return 0; } |