Bug #79974 "Out of range value for column '(null)'" is not clear enough

Submitted: 14 Jan 2016 3:04 Modified: 14 Jan 2016 5:23
Reporter: Su Dylan Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.7.8, 5.5.48, 5.6.28, 5.7.10 OS:Any
Assigned to: CPU Architecture:Any

[14 Jan 2016 3:04] Su Dylan
Description:
Output:
=====
mysql> select cast(1000 as decimal(1)) > 0; show warnings;
+------------------------------+
| cast(1000 as decimal(1)) > 0 |
+------------------------------+
|                            1 |
+------------------------------+
1 row in set, 1 warning (0.00 sec)

+---------+------+-------------------------------------------------+
| Level   | Code | Message                                         |
+---------+------+-------------------------------------------------+
| Warning | 1264 | Out of range value for column '(null)' at row 1 |
+---------+------+-------------------------------------------------+
1 row in set (0.00 sec)

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.7.8-rc  |
+-----------+
1 row in set (0.00 sec)

Problem:
=====

How to repeat:
select cast(1000 as decimal(1)) > 0; show warnings;

Suggested fix:
Clearer message is expected:
| Warning | 1264 | Out of range value for column 'cast(1000 as decimal(1))' at row 1 |
[14 Jan 2016 5:23] MySQL Verification Team
Hello Su Dylan,

Thank you for the report and test case.

Thanks,
Umesh
[14 Jan 2016 13:08] Peter Laursen
I don't understand why there is a warning here at all. What is truncated? 

-- Peter
-- not a MySQL/Oracle person

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.038 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.