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

Inconsistent BIGINT overflow behavior with unary minus operator in multiplication

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 11.4.2, 11.7.2, 10.11.13, 11.8.2
    • 10.11, 11.4, 11.8
    • Data types, Parser
    • None
    • win11 with docker

    Description

      MariaDB shows inconsistent behavior when handling mathematically equivalent expressions involving unary minus operators and large number multiplication.

      How to repeat:

      1. Execute: select 10000000000 * (-(-10000 * 100000)) AS ref0;
      result: 10000000000000000000(correct)
      2. Execute: select 10000000000 * ((10000 * 100000)) AS ref0;
      result: ERROR 1690 (22003): BIGINT value is out of range in '10000000000 * (10000 * 100000)'

      Attachments

        Activity

          People

            bar Alexander Barkov
            Phasheng Bosheng Peng
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.