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

Cast issue with Cast to INTEGER In IF Statement

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5.12, 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5(EOL), 10.6
    • None
    • None
    • None
    • DEBIAN

    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

      Attachments

        Activity

          People

            Unassigned Unassigned
            gvlpehqwiaddujczlw@zqrni.net gvlpehqwiaddujczlw@zqrni.net
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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