[MDEV-5893] CAST(LEAST('11','2') AS DECIMAL) returns a wrong result Created: 2014-03-18  Updated: 2022-12-02

Status: Confirmed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.3.12, 5.5.35, 10.0.9, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9
Fix Version/s: 5.5, 10.3

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


 Description   

mysql> SELECT LEAST('11','2'), CAST(LEAST('11','2') AS DECIMAL);
+-----------------+----------------------------------+
| LEAST('11','2') | CAST(LEAST('11','2') AS DECIMAL) |
+-----------------+----------------------------------+
| 11              |                                2 |
+-----------------+----------------------------------+
1 row in set (0.01 sec)

The result for CAST(LEAST()) is wrong.
The expected result is 11, similar to what LEAST('11,'2') returns.


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