Bug #68745 "truncated" warnings in my_decimal do not show truncated value
Submitted: 22 Mar 2013 13:04 Modified: 3 Oct 2013 17:16
Reporter: Tatjana Nuernberg Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Data Types Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[22 Mar 2013 13:04] Tatjana Nuernberg
Description:
decimal_operation_results() in my_decimal.cc does not receive
the dubious input value it is to generate a warning about;
it therefore can only print warnings of the form "bad value ''"

How to repeat:
SELECT CAST(789999999999999999999999999999 AS UNSIGNED) FROM (SELECT 1) t1;
CAST(789999999999999999999999999999 AS UNSIGNED)
18446744073709551615
Warnings:
Warning	1292	Truncated incorrect DECIMAL value: ''

Suggested fix:
Fix signature and callers in my_decimal.h etc. if possible.
[23 Mar 2013 18:30] MySQL Verification Team
Hello Tatjana,

Thank you for the report.
Verified as described

[root@ushastry mysql-5.6.10]# bin/mysql -u root -p -S /tmp/5610_/sock 
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.10-debug-log Source distribution

mysql> SELECT CAST(789999999999999999999999999999 AS UNSIGNED) FROM (SELECT 1) t1;
+--------------------------------------------------+
| CAST(789999999999999999999999999999 AS UNSIGNED) |
+--------------------------------------------------+
|                             18446744073709551615 |
+--------------------------------------------------+
1 row in set, 1 warning (0.01 sec)

mysql> show warnings;
+---------+------+---------------------------------------+
| Level   | Code | Message                               |
+---------+------+---------------------------------------+
| Warning | 1292 | Truncated incorrect DECIMAL value: '' |
+---------+------+---------------------------------------+
1 row in set (0.00 sec)

mysql> 

Thanks,
Umesh
[3 Oct 2013 17:08] Paul DuBois
Bug need not be private.
[3 Oct 2013 17:16] Paul DuBois
Noted in 5.7.3 changelog.

ER_TRUNCATED_WRONG_VALUE (truncated value) errors for DECIMAL values
failed to show the erroneous input value.