Bug #70286 | Case does compare against null | ||
---|---|---|---|
Submitted: | 10 Sep 2013 15:38 | Modified: | 10 Oct 2013 21:17 |
Reporter: | George Kremenliev | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: Data Types | Severity: | S3 (Non-critical) |
Version: | OS: | Any | |
Assigned to: | CPU Architecture: | Any |
[10 Sep 2013 15:38]
George Kremenliev
[10 Sep 2013 21:17]
MySQL Verification Team
http://dev.mysql.com/doc/refman/5.7/en/case.html This syntax cannot be used to test for equality with NULL because NULL = NULL is false. See Section 3.3.4.6, “Working with NULL Values”. A test: --- drop table if exists f; create table f(a datetime default null); insert f values (null), ('20130101120020'); select case a when null then now() else a end from f; #expect a null return select ifnull(a,now()) from f; select coalesce(a,now()) from f; ---- So the situation seen seems expected..
[11 Oct 2013 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".