diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-03-18 13:43:33 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-03-18 13:43:33 +0100 |
commit | 5ff5c4b8a32a74501aace277766df4c336c62157 (patch) | |
tree | 7b1bdc32928b43789b53f6795473fd7718b7e4b8 /sql/item_timefunc.cc | |
parent | 1a963822c80ada2ea82a8a07c09870070fb6a820 (diff) | |
download | mariadb-git-5ff5c4b8a32a74501aace277766df4c336c62157.tar.gz |
lp:737111 Different behavior for TIMESTAMPADD with 0000-00-00 argument in 5.1-micro
respect fuzzydate flags in Item_*::get_date() methods
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index b27e9d72cfc..6ca15873199 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2309,7 +2309,7 @@ bool Item_time_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date) bool Item_date_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date) { - if (get_arg0_date(ltime, TIME_FUZZY_DATE)) + if (get_arg0_date(ltime, fuzzy_date & ~TIME_TIME_ONLY)) return 1; ltime->hour= ltime->minute= ltime->second= ltime->second_part= 0; ltime->time_type= MYSQL_TIMESTAMP_DATE; @@ -2318,11 +2318,11 @@ bool Item_date_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date) bool Item_datetime_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date) { - if (get_arg0_date(ltime, TIME_FUZZY_DATE)) + if (get_arg0_date(ltime, fuzzy_date & ~TIME_TIME_ONLY)) return 1; /* - ltime is valid MYSQL_TYPE_TIME ( according to fuzzy_date). + ltime is valid MYSQL_TYPE_TIME (according to fuzzy_date). But not every valid TIME value is a valid DATETIME value! */ if (ltime->time_type == MYSQL_TIMESTAMP_TIME && ltime->hour >= 24) |