Warning 1292 Incorrect interval value: '42949672955959.123456000' for column 'b' at row 4
Warning 1292 Incorrect interval value: '42949672955959.123456000' for column 'b' at row 4
Warning 1292 Incorrect interval value: '42949672955959.123456000' for column 'b' at row 4
Warning 1292 Incorrect INTERVAL DAY TO SECOND value: '876494165959.123456000'
Warning 1292 Incorrect interval value: '876494165959.123456000' for column 'b' at row 5
Warning 1292 Incorrect interval value: '876494165959.123456000' for column 'b' at row 5
Warning 1292 Incorrect interval value: '876494165959.123456000' for column 'b' at row 5
...
...
@@ -191,6 +203,18 @@ Warning 1292 Incorrect interval value: '876494165959.123456000' for column 'b' a
Warning 1292 Incorrect interval value: '876494165959.123456000' for column 'b' at row 5
Warning 1292 Incorrect interval value: '876494165959.123456000' for column 'b' at row 5
Warning 1292 Incorrect interval value: '876494165959.123456000' for column 'b' at row 5
Note 1292 Truncated incorrect INTERVAL DAY TO SECOND value: '876494155959.123456000'
Note 1292 Truncated incorrect INTERVAL DAY TO SECOND value: '876494145959.123456000'
Note 1292 Truncated incorrect INTERVAL DAY TO SECOND value: '99995959.123456000'
Note 1292 Truncated incorrect INTERVAL DAY TO SECOND value: '99990101.123456000'
Note 1292 Truncated incorrect INTERVAL DAY TO SECOND value: '99990101.000000000'
Note 1292 Truncated incorrect INTERVAL DAY TO SECOND value: '0.999999000'
Note 1292 Truncated incorrect INTERVAL DAY TO SECOND value: '0.999990000'
Note 1292 Truncated incorrect INTERVAL DAY TO SECOND value: '0.999900000'
Note 1292 Truncated incorrect INTERVAL DAY TO SECOND value: '0.999000000'
Note 1292 Truncated incorrect INTERVAL DAY TO SECOND value: '0.990000000'
Note 1292 Truncated incorrect INTERVAL DAY TO SECOND value: '0.900000000'
Note 1292 Truncated incorrect INTERVAL DAY TO SECOND value: '0.000000000'
DROP TABLE t1;
# Special case: DAY + TIME
CREATE TABLE t1 (a VARCHAR(64));
...
...
@@ -213,6 +237,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(64));
INSERT INTO t1 VALUES ('');
SELECT a,
CAST(a AS INTERVAL DAY_SECOND(6)) AS cidm,
EXTRACT(DAY_HOUR FROM a),
EXTRACT(DAY_MINUTE FROM a),
EXTRACT(DAY_SECOND FROM a),
...
...
@@ -223,9 +248,10 @@ EXTRACT(MINUTE FROM a),
EXTRACT(SECOND FROM a),
EXTRACT(MICROSECOND FROM a)
FROM t1;
a EXTRACT(DAY_HOUR FROM a) EXTRACT(DAY_MINUTE FROM a) EXTRACT(DAY_SECOND FROM a) EXTRACT(DAY_MICROSECOND FROM a) EXTRACT(DAY FROM a) EXTRACT(HOUR FROM a) EXTRACT(MINUTE FROM a) EXTRACT(SECOND FROM a) EXTRACT(MICROSECOND FROM a)
NULL NULL NULL NULL NULL NULL NULL NULL NULL
a cidm EXTRACT(DAY_HOUR FROM a) EXTRACT(DAY_MINUTE FROM a) EXTRACT(DAY_SECOND FROM a) EXTRACT(DAY_MICROSECOND FROM a) EXTRACT(DAY FROM a) EXTRACT(HOUR FROM a) EXTRACT(MINUTE FROM a) EXTRACT(SECOND FROM a) EXTRACT(MICROSECOND FROM a)
NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
Warnings:
Warning 1292 Incorrect INTERVAL DAY TO SECOND value: ''
Warning 1292 Incorrect interval value: ''
Warning 1292 Incorrect interval value: ''
Warning 1292 Incorrect interval value: ''
...
...
@@ -523,33 +549,44 @@ INSERT INTO t1 VALUES
('01:02:03;'),
('01:02:03/'),
('20 10:20:30');
SELECT EXTRACT(DAY FROM a), EXTRACT(DAY_SECOND FROM a), a FROM t1;
EXTRACT(DAY FROM a) EXTRACT(DAY_SECOND FROM a) a
84 84080103 2024:01:03 garbage /////
1 1000103 24:01:03 garbage /////
0 10103 01:01:03 garbage /////
84 84080203 2024:02:03
4166 4166160203 100000:02:03
1 1000203 24:02:03
0 10203 01:02:03
0 10203 01:02:03:
0 10203 01:02:03-
0 10203 01:02:03;
0 10203 01:02:03/
20 20102030 20 10:20:30
SELECT
EXTRACT(DAY FROM a),
EXTRACT(DAY_SECOND FROM a), a,
CAST(a AS INTERVAL DAY_SECOND(6)) AS cidm
FROM t1;
EXTRACT(DAY FROM a) EXTRACT(DAY_SECOND FROM a) a cidm
84 84080103 2024:01:03 garbage ///// NULL
1 1000103 24:01:03 garbage ///// NULL
0 10103 01:01:03 garbage ///// NULL
84 84080203 2024:02:03 84 08:02:03.000000
4166 4166160203 100000:02:03 4166 16:02:03.000000
1 1000203 24:02:03 1 00:02:03.000000
0 10203 01:02:03 01:02:03.000000
0 10203 01:02:03: 01:02:03.000000
0 10203 01:02:03- NULL
0 10203 01:02:03; 01:02:03.000000
0 10203 01:02:03/ 01:02:03.000000
20 20102030 20 10:20:30 20 10:20:30.000000
Warnings:
Warning 1292 Truncated incorrect time value: '2024:01:03 garbage /////'
Warning 1292 Truncated incorrect time value: '2024:01:03 garbage /////'
Warning 1292 Incorrect INTERVAL DAY TO SECOND value: '2024:01:03 garbage /////'
Warning 1292 Truncated incorrect time value: '24:01:03 garbage /////'
Warning 1292 Truncated incorrect time value: '24:01:03 garbage /////'
Warning 1292 Incorrect INTERVAL DAY TO SECOND value: '24:01:03 garbage /////'
Warning 1292 Truncated incorrect time value: '01:01:03 garbage /////'
Warning 1292 Truncated incorrect time value: '01:01:03 garbage /////'
Warning 1292 Incorrect INTERVAL DAY TO SECOND value: '01:01:03 garbage /////'
Warning 1292 Truncated incorrect time value: '01:02:03:'
Warning 1292 Truncated incorrect time value: '01:02:03:'
Warning 1292 Truncated incorrect INTERVAL DAY TO SECOND value: '01:02:03:'
Warning 1292 Truncated incorrect time value: '01:02:03-'
Warning 1292 Truncated incorrect time value: '01:02:03-'
Warning 1292 Incorrect INTERVAL DAY TO SECOND value: '01:02:03-'
Warning 1292 Truncated incorrect time value: '01:02:03;'
Warning 1292 Truncated incorrect time value: '01:02:03;'
Warning 1292 Truncated incorrect INTERVAL DAY TO SECOND value: '01:02:03;'
Warning 1292 Truncated incorrect time value: '01:02:03/'
Warning 1292 Truncated incorrect time value: '01:02:03/'
Warning 1292 Truncated incorrect INTERVAL DAY TO SECOND value: '01:02:03/'