Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-22362

Number of digits wrong for round if round is within an if or case construct

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 5.5.67, 10.4.12, 5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
    • N/A
    • N/A
    • None

    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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lhersch Lars Herschke
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.