Commit 07cb53c5 authored by Alexander Barkov's avatar Alexander Barkov

Merge 5.3->5.5

parents be002655 80708da1
...@@ -2416,3 +2416,18 @@ c1 c2 ...@@ -2416,3 +2416,18 @@ c1 c2
9923-03-10 22:47:10.0 NULL 9923-03-10 22:47:10.0 NULL
Warnings: Warnings:
Warning 1292 Truncated incorrect DECIMAL value: '2000000000000000000.0' Warning 1292 Truncated incorrect DECIMAL value: '2000000000000000000.0'
#
# MDEV-5750 Assertion `ltime->year == 0' fails on a query with EXTRACT DAY_MINUTE and TIME column
#
CREATE TABLE t1 ( d DATE, t TIME );
INSERT INTO t1 VALUES ('2008-12-05','22:34:09'),('2005-03-27','14:26:02');
SELECT EXTRACT(DAY_MINUTE FROM GREATEST(t,d)), GREATEST(t,d) FROM t1;
EXTRACT(DAY_MINUTE FROM GREATEST(t,d)) GREATEST(t,d)
342259 838:59:59
342259 838:59:59
Warnings:
Warning 1292 Truncated incorrect time value: '9336:00:00'
Warning 1292 Truncated incorrect time value: '9336:00:00'
Warning 1292 Truncated incorrect time value: '2952:00:00'
Warning 1292 Truncated incorrect time value: '2952:00:00'
DROP TABLE t1;
...@@ -1472,3 +1472,12 @@ DROP TABLE t1; ...@@ -1472,3 +1472,12 @@ DROP TABLE t1;
--echo # MDEV-6099 Bad results for DATE_ADD(.., INTERVAL 2000000000000000000.0 SECOND) --echo # MDEV-6099 Bad results for DATE_ADD(.., INTERVAL 2000000000000000000.0 SECOND)
--echo # --echo #
SELECT DATE_ADD('2001-01-01 10:20:30',INTERVAL 250000000000.0 SECOND) AS c1, DATE_ADD('2001-01-01 10:20:30',INTERVAL 2000000000000000000.0 SECOND) AS c2; SELECT DATE_ADD('2001-01-01 10:20:30',INTERVAL 250000000000.0 SECOND) AS c1, DATE_ADD('2001-01-01 10:20:30',INTERVAL 2000000000000000000.0 SECOND) AS c2;
--echo #
--echo # MDEV-5750 Assertion `ltime->year == 0' fails on a query with EXTRACT DAY_MINUTE and TIME column
--echo #
CREATE TABLE t1 ( d DATE, t TIME );
INSERT INTO t1 VALUES ('2008-12-05','22:34:09'),('2005-03-27','14:26:02');
SELECT EXTRACT(DAY_MINUTE FROM GREATEST(t,d)), GREATEST(t,d) FROM t1;
DROP TABLE t1;
...@@ -2960,7 +2960,7 @@ bool Item_func_min_max::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) ...@@ -2960,7 +2960,7 @@ bool Item_func_min_max::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{ {
ltime->time_type= MYSQL_TIMESTAMP_TIME; ltime->time_type= MYSQL_TIMESTAMP_TIME;
ltime->hour+= (ltime->month * 32 + ltime->day) * 24; ltime->hour+= (ltime->month * 32 + ltime->day) * 24;
ltime->month= ltime->day= 0; ltime->year= ltime->month= ltime->day= 0;
if (adjust_time_range_with_warn(ltime, if (adjust_time_range_with_warn(ltime,
min(decimals, TIME_SECOND_PART_DIGITS))) min(decimals, TIME_SECOND_PART_DIGITS)))
return (null_value= true); return (null_value= true);
......
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