Bug #95045 | Data Truncation error occurred on a write of column 0Data was 0 bytes long and | ||
---|---|---|---|
Submitted: | 17 Apr 2019 16:53 | Modified: | 14 May 2019 11:58 |
Reporter: | Adarshdeep Cheema | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
Version: | 8.0.15, 8.0.14 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | regression |
[17 Apr 2019 16:53]
Adarshdeep Cheema
[17 Apr 2019 19:24]
MySQL Verification Team
Thank you for the bug report. Please provide the complete sq
[17 Apr 2019 19:25]
MySQL Verification Team
Sorry for truncated prior comment. Please provide the complete sql script (create table, insert data, query). Thanks in advance.
[17 Apr 2019 19:38]
Adarshdeep Cheema
CREATE: CREATE TABLE Datetime_table (QC_DATE_KEY BIGINT (20), QC_DATE DATE,QC_TIMESTAMP DATETIME); INSERT: INSERT INTO Datetime_table(QC_DATE_KEY,QC_DATE,QC_TIMESTAMP) VALUES(1,'1999-02-28', '1999-11-28 14:45:00'); INSERT INTO Datetime_table(QC_DATE_KEY,QC_DATE,QC_TIMESTAMP) VALUES(2,'1999-12-31', '2000-01-01 00:00:00'); INSERT INTO Datetime_table(QC_DATE_KEY,QC_DATE,QC_TIMESTAMP) VALUES(3,'2000-02-28', '2000-02-28 23:59:00'); QUERY: SELECT ((year(`QC_DATE`) - year(`QC_TIMESTAMP`))) FROM `DATETIME_TABLE` WHERE `QC_DATE_KEY` = 2
[19 Apr 2019 5:54]
MySQL Verification Team
Thank you for providing requested details. Issue seen since 8.0.14, earlier versions don't show overflow error. thanks, Umesh
[22 Apr 2019 12:23]
Adarshdeep Cheema
Can you please let us know in which MySQL version we can expect its fix
[14 May 2019 11:57]
Jon Stephens
Adarshdeep, we don't know that ourselves until the issue is actually fixed.
[14 May 2019 11:58]
Jon Stephens
Documented fix in the MySQL 8.0.17 changelog as follows: A fix for a previous issue caused YEAR values to be treated as unsigned, but this did not allow for possible negative values arising during calculations involving subtraction, which could lead to data truncation errors. Regression of BUG#92209. Closed.