mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
Merge mysql.com:/usr/home/ram/work/bug23653/my50-bug23653
into mysql.com:/usr/home/ram/work/bug23653/my51-bug23653
This commit is contained in:
commit
6ce719c515
3 changed files with 11 additions and 1 deletions
|
@ -1047,6 +1047,9 @@ union
|
|||
(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 HOUR)),'%k') As H);
|
||||
H
|
||||
5
|
||||
select last_day('0000-00-00');
|
||||
last_day('0000-00-00')
|
||||
NULL
|
||||
End of 4.1 tests
|
||||
explain extended select timestampdiff(SQL_TSI_WEEK, '2001-02-01', '2001-05-01') as a1,
|
||||
timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:58:58.119999') as a2;
|
||||
|
|
|
@ -565,6 +565,12 @@ union
|
|||
union
|
||||
(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 HOUR)),'%k') As H);
|
||||
|
||||
#
|
||||
# Bug #23653: crash if last_day('0000-00-00')
|
||||
#
|
||||
|
||||
select last_day('0000-00-00');
|
||||
|
||||
--echo End of 4.1 tests
|
||||
|
||||
explain extended select timestampdiff(SQL_TSI_WEEK, '2001-02-01', '2001-05-01') as a1,
|
||||
|
|
|
@ -3244,7 +3244,8 @@ String *Item_func_str_to_date::val_str(String *str)
|
|||
|
||||
bool Item_func_last_day::get_date(TIME *ltime, uint fuzzy_date)
|
||||
{
|
||||
if (get_arg0_date(ltime, fuzzy_date & ~TIME_FUZZY_DATE))
|
||||
if (get_arg0_date(ltime, fuzzy_date & ~TIME_FUZZY_DATE) ||
|
||||
(ltime->month == 0))
|
||||
return 1;
|
||||
uint month_idx= ltime->month-1;
|
||||
ltime->day= days_in_month[month_idx];
|
||||
|
|
Loading…
Reference in a new issue