[MDEV-6649] Different warnings for TIME and TIME(N) when @@old_mode=zero_date_time_cast Created: 2014-08-27  Updated: 2015-01-28  Resolved: 2014-10-20

Status: Closed
Project: MariaDB Server
Component/s: Temporal Types
Affects Version/s: 10.0.13
Fix Version/s: 10.0.15

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None


 Description   

This script:

SET @@old_mode=zero_date_time_cast;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a TIME,b TIME(1));
INSERT INTO t1 VALUES (TIME'830:20:30',TIME'830:20:30');
SELECT TO_DAYS(a), TO_DAYS(b) FROM t1;
SHOW WARNINGS;

produces the following output:

...
MariaDB [test]> SELECT TO_DAYS(a), TO_DAYS(b) FROM t1;
+------------+------------+
| TO_DAYS(a) | TO_DAYS(b) |
+------------+------------+
|       NULL |       NULL |
+------------+------------+
1 row in set, 1 warning (0.00 sec)
 
MariaDB [test]> SHOW WARNINGS;
+---------+------+--------------------------------------------+
| Level   | Code | Message                                    |
+---------+------+--------------------------------------------+
| Warning | 1264 | Out of range value for column 'a' at row 1 |
+---------+------+--------------------------------------------+
1 row in set (0.00 sec)

Notice, the warning was correctly displayed for the column 'a',
but was not displayed for the column 'b'.


Generated at Thu Feb 08 07:13:33 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.