Commit cafe9d13 authored by Alexander Barkov's avatar Alexander Barkov

Merge from 5.3

pending merges:
  Alexander Barkov 2013-08-08 MDEV-4653 Wrong result for CONVERT_TZ(TIME('...
parents 62484d2e e9db0da7
...@@ -309,3 +309,22 @@ CONVERT_TZ(1, 1, a) ...@@ -309,3 +309,22 @@ CONVERT_TZ(1, 1, a)
NULL NULL
DROP TABLE t1; DROP TABLE t1;
End of 5.1 tests End of 5.1 tests
#
# Start of 5.3 tests
#
#
# MDEV-4653 Wrong result for CONVERT_TZ(TIME('00:00:00'),'+00:00','+7:5')
#
SELECT CONVERT_TZ(TIME('00:00:00'),'+00:00','+7:5');
CONVERT_TZ(TIME('00:00:00'),'+00:00','+7:5')
NULL
Warnings:
Warning 1292 Incorrect datetime value: '00:00:00'
SELECT CONVERT_TZ(TIME('2010-01-01 00:00:00'),'+00:00','+7:5');
CONVERT_TZ(TIME('2010-01-01 00:00:00'),'+00:00','+7:5')
NULL
Warnings:
Warning 1292 Incorrect datetime value: '00:00:00'
#
# End of 5.3 tests
#
...@@ -284,3 +284,19 @@ SELECT CONVERT_TZ(1, 1, a) FROM t1; ...@@ -284,3 +284,19 @@ SELECT CONVERT_TZ(1, 1, a) FROM t1;
DROP TABLE t1; DROP TABLE t1;
--echo End of 5.1 tests --echo End of 5.1 tests
--echo #
--echo # Start of 5.3 tests
--echo #
--echo #
--echo # MDEV-4653 Wrong result for CONVERT_TZ(TIME('00:00:00'),'+00:00','+7:5')
--echo #
SELECT CONVERT_TZ(TIME('00:00:00'),'+00:00','+7:5');
SELECT CONVERT_TZ(TIME('2010-01-01 00:00:00'),'+00:00','+7:5');
--echo #
--echo # End of 5.3 tests
--echo #
...@@ -2032,7 +2032,9 @@ bool Item_date_add_interval::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) ...@@ -2032,7 +2032,9 @@ bool Item_date_add_interval::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{ {
INTERVAL interval; INTERVAL interval;
if (args[0]->get_date(ltime, 0) || if (args[0]->get_date(ltime,
cached_field_type == MYSQL_TYPE_TIME ?
TIME_TIME_ONLY : 0) ||
get_interval_value(args[1], int_type, &interval)) get_interval_value(args[1], int_type, &interval))
return (null_value=1); return (null_value=1);
...@@ -2423,7 +2425,9 @@ bool Item_time_typecast::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) ...@@ -2423,7 +2425,9 @@ bool Item_time_typecast::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
if (ltime->time_type != MYSQL_TIMESTAMP_TIME) if (ltime->time_type != MYSQL_TIMESTAMP_TIME)
ltime->year= ltime->month= ltime->day= 0; ltime->year= ltime->month= ltime->day= 0;
ltime->time_type= MYSQL_TIMESTAMP_TIME; ltime->time_type= MYSQL_TIMESTAMP_TIME;
return 0; return (fuzzy_date & TIME_TIME_ONLY) ? 0 :
(null_value= check_date_with_warn(ltime, fuzzy_date,
MYSQL_TIMESTAMP_ERROR));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment