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

Inconsistent results for ATAN2 function

    XMLWordPrintable

Details

    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:
            3 Start watching this issue

            Dates

              Created:
              Updated: