[MDEV-26563] Cast issue with Cast to INTEGER In IF Statement Created: 2021-09-07  Updated: 2021-09-07

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.5.12, 10.2, 10.3, 10.4, 10.5, 10.6
Fix Version/s: None

Type: Bug Priority: Major
Reporter: gvlpehqwiaddujczlw@zqrni.net Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

DEBIAN


Attachments: PNG File CAST ISSUE 10.5.12.png    

 Description   

When CAST to DECIMAL and CAST TO INTEGER are in the same IF Statement it will always output the result as DECIMAL

SELECT
    IF(
        1=2,
        MAX(CAST('100' AS DECIMAL(60, 30))),
        MAX(CAST('10' AS INTEGER))
    ) AS test

Expected Result: 10
Given Result 10.000000000000000000000000000000


Generated at Thu Feb 08 09:46:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.