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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None

    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)

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.