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

Strange type-inference/rounding problem since >10.3.23

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Duplicate
    • 10.1.46, 10.3.24, 10.4.14, 10.5.5
    • N/A
    • Optimizer
    • CentOS7

    Description

      Hi,
      we have some problems with "POW()" or the inference of the term: (1/(1+(0.0275/12)).
      Since upgrading to any version above 10.3.23, the statement

      SELECT POW((1/(1+(0.0275/12))), 59)
      

      yield complete interesting (and wrong) results.

      SELECT VERSION(), POW((1/(1+(0.0275/12))), 59), POW((1/(1+(CAST(0.0275/12 as double)))), 59), POW((1.0/(1.0+(0.0275/12.0))), 59)
      

      produces:

      # VERSION(), POW((1/(1+(0.0275/12))), 59), POW((1/(1+(CAST(0.0275/12 as double)))), 59), POW((1.0/(1.0+(0.0275/12.0))), 59)
      '10.3.23-MariaDB', '0.8736690781345217', '0.8736690781345217', '0.8736690438487815'
      '10.5.5-MariaDB', '0.8729680736160053', '0.8736688724200776', '0.8734844622108874'
      

      Can you explain/confirm/fix this issue? The first Column was our usecase and differs a lot between these versions!

      Greetings,
      Robin

      Attachments

        Issue Links

          Activity

            People

              varun Varun Gupta (Inactive)
              theolymp Robin Parker
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.