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

Wrong result for SELECT..WHERE year_field=2020 AND NULLIF(year_field,2010)='2020'

    XMLWordPrintable

    Details

      Description

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a YEAR);
      INSERT INTO t1 VALUES (2010),(2020);
      SELECT * FROM t1 WHERE a=2020;
      SELECT * FROM t1 WHERE NULLIF(a,2010)='2020';
      SELECT * FROM t1 WHERE a=2020 AND NULLIF(a,2010)='2020';

      The first and the second SELECT queries correctly return one row, and third SELECT query erroneously returns emptu set.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: