[MDEV-22362] Number of digits wrong for round if round is within an if or case construct Created: 2020-04-24  Updated: 2020-05-05  Resolved: 2020-04-30

Status: Closed
Project: MariaDB Server
Component/s: N/A
Affects Version/s: 5.5, 10.0, 10.1, 5.5.67, 10.4.12, 10.2, 10.3, 10.4
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Lars Herschke Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-7297 IF() function consults 3rd argument t... Closed

 Description   

If you use the round function within an if or case construct, the number of digits may not be correct.

Statement: select if(true, round(1.190000, 2), round(1.00000, 6));
Expected result: 1.19
Actual result: 1.190000

Workaround: Move the round outside.
Statement: select round(if(true, 1.190000, 1.000000), if(true, 2, 6));
Expected result: 1.19
Actual result: 1.19

The bug came from version 5.5.32 to version 5.5.33 and from version 10.0.4 to version 10.0.5.
The 10.1, 10.2, 10.3 and 10.4 branches are affected in all versions.


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