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

Inconsistent results for ATAN2 function

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6, 10.11, 11.4, 12.1(EOL), 11.8.3, 11.8
    • 10.11, 11.4, 11.8
    • Data types, Server
    • None

    Description

      I run the following two cases, in which the same query should return the same result. However, different results are returned. A value 0 may be correct.

      DROP TABLE t1;
      CREATE TABLE t1 (c1 CHAR(20), UNIQUE (c1));
      INSERT INTO t1 VALUES ('a');
      SELECT ATAN2(c1, BIT_OR(-1.0)) FROM t1 GROUP BY c1; -- {3.141592653589793}
      

      DROP TABLE t1;
      CREATE TABLE t1 (c1 MEDIUMTEXT, UNIQUE(c1));
      INSERT INTO t1 VALUES ('a');
      SELECT ATAN2(c1, BIT_OR(-1.0)) FROM t1 GROUP BY c1; -- {0}
      

      Attachments

        Activity

          People

            bar Alexander Barkov
            John Jove John Jove
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.