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

LP:993103 - Wrong result with LAST_DAY('0000-00-00 00:00:00') IS NULL in WHERE condition

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      The following sequence of commands returns incorrect result in MariaDB 5.2:

      CREATE TABLE t1(a INT) ENGINE=InnoDB;
      INSERT INTO t1 VALUES(1);
      SELECT * FROM t1 WHERE LAST_DAY('0000-00-00 00:00:00') IS NULL;

      MariaDB [test]> SELECT * FROM t1 WHERE LAST_DAY('0000-00-00 00:00:00') IS NULL;
      Empty set (0.01 sec)

      The expected result is:
      MariaDB [test]> SELECT * FROM t1 WHERE LAST_DAY('0000-00-00 00:00:00') IS NULL;
      ------

      a

      ------

      1

      ------

      (see also bug #13626019 for mysql)

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 993103

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 993103

              People

              • Assignee:
                wlad Vladislav Vaintroub
                Reporter:
                igor Igor Babaev
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: