[MDEV-5940] Inconsistent warnings when converting string to decimal Created: 2014-03-24  Updated: 2022-11-02  Resolved: 2022-11-02

Status: Closed
Project: MariaDB Server
Component/s: Data types
Affects Version/s: 10.0.9
Fix Version/s: N/A

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

Issue Links:
Relates
relates to MDEV-5945 Warning generation is inconsistent wh... Closed

 Description   

mysql> select cast('' as decimal(30,1)), cast(concat('') as decimal(30,1)); show warnings;
+---------------------------+-----------------------------------+
| cast('' as decimal(30,1)) | cast(concat('') as decimal(30,1)) |
+---------------------------+-----------------------------------+
|                       0.0 |                               0.0 |
+---------------------------+-----------------------------------+
1 row in set, 2 warnings (0.00 sec)
 
+---------+------+---------------------------------------------------------+
| Level   | Code | Message                                                 |
+---------+------+---------------------------------------------------------+
| Warning | 1292 | Truncated incorrect DECIMAL value: ''                   |
| Warning | 1918 | Encountered illegal value '' when converting to DECIMAL |
+---------+------+---------------------------------------------------------+
2 rows in set (0.00 sec)

The warnings should probably be the same for both values.



 Comments   
Comment by Sergei Golubchik [ 2022-11-02 ]

fixed before 10.3.37

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