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'

    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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              There are no comments yet on this issue.

                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: