Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.0.6
-
None
-
None
Description
This SQL script
DROP TABLE IF EXISTS t1;
|
CREATE TABLE t1 (a INT, b REAL, c DECIMAL(20,6), d TIME,e CHAR(30));
|
INSERT INTO t1 VALUES (-1,-1,-1,'-800:10:10','-800:10:10');
|
SELECT CAST(a AS DATETIME) AS a, CAST(b AS DATETIME) AS b, CAST(c AS DATETIME) AS c,
|
CAST(d AS DATETIME) AS d, CAST(e AS datetime) AS e FROM t1;
|
SHOW WARNINGS;
|
returns NULL for all columns:
+------+------+------+------+------+
|
| a | b | c | d | e |
|
+------+------+------+------+------+
|
| NULL | NULL | NULL | NULL | NULL |
|
+------+------+------+------+------+
|
1 row in set, 5 warnings (0.00 sec)
|
which is OK.
But the warnings returned are different:
+---------+------+--------------------------------------------------------+
|
| Level | Code | Message |
|
+---------+------+--------------------------------------------------------+
|
| Warning | 1292 | Incorrect datetime value: '-1' |
|
| Warning | 1292 | Incorrect datetime value: '-1' for column 'b' at row 1 |
|
| Warning | 1292 | Incorrect datetime value: '-1.000000' |
|
| Warning | 1292 | Truncated incorrect datetime value: '-800:10:10' |
|
| Warning | 1292 | Incorrect datetime value: '-800:10:10' |
|
+---------+------+--------------------------------------------------------+
|
5 rows in set (0.00 sec)
|
Notice three different warning versions.
This should probably be fixed to return the same warning
for all column types.