[MDEV-9392] Copying from DECIMAL to YEAR is not consistent about warnings Created: 2016-01-11  Updated: 2016-01-11  Resolved: 2016-01-11

Status: Closed
Project: MariaDB Server
Component/s: Temporal Types
Affects Version/s: 5.5, 10.0, 10.1, 10.2
Fix Version/s: 10.2.0

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

Issue Links:
Blocks
blocks MDEV-4912 Data type plugin API version 1 Closed

 Description   

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a YEAR);
INSERT INTO t1 VALUES (-0.1);
SHOW WARNINGS;

correctly reports warnings:

+---------+------+--------------------------------------------+
| Level   | Code | Message                                    |
+---------+------+--------------------------------------------+
| Warning | 1264 | Out of range value for column 'a' at row 1 |
+---------+------+--------------------------------------------+

So does copying:

DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (a YEAR);
CREATE TABLE t2 (a DECIMAL(10,1));
INSERT INTO t2 VALUES (-0.1);
INSERT INTO t1 SELECT * FROM t2;
SHOW WARNINGS;

While ALTER does not return any warnings:

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a DECIMAL(10,1));
INSERT INTO t1 VALUES (-0.1);
ALTER TABLE t1 MODIFY a YEAR;
SHOW WARNINGS;



 Comments   
Comment by Alexander Barkov [ 2016-01-11 ]

The same problem is repeatable when converting from DOUBLE to YEAR.

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