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

Bug #993103 reported by Igor Babaev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Committed
Medium
Vladislav Vaintroub

Bug 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)

Tags: wrong-result
Changed in maria:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Vladislav Vaintroub (wlad-montyprogram)
milestone: none → 5.2
Changed in maria:
status: Confirmed → Fix Committed
Elena Stepanova (elenst)
tags: added: wrong-result
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.