[MDEV-7831] Bad warning for DATE_ADD(timestamp_column, INTERVAL 10 SECOND) Created: 2015-03-25  Updated: 2015-03-25  Resolved: 2015-03-25

Status: Closed
Project: MariaDB Server
Component/s: Temporal Types
Affects Version/s: 5.5.42, 10.0.17, 10.1.3
Fix Version/s: 10.1.4

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

Issue Links:
Blocks
blocks MDEV-3929 Add system variable explicit_defaults... Closed

 Description   

This script:

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a TIMESTAMP);
INSERT INTO t1 VALUES ('0000-00-00 00:00:00');
SELECT DATE_ADD(a, INTERVAL 10 SECOND) FROM t1;
SHOW WARNINGS;

returns:

+---------+------+----------------------------------------+
| Level   | Code | Message                                |
+---------+------+----------------------------------------+
| Warning | 1292 | Incorrect datetime value: '0000-00-00' |
+---------+------+----------------------------------------+

The expected warning would be:

Incorrect datetime value: '0000-00-00 00:00:00'


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