[MDEV-3299] LP:817360 - Wrong result with NOT NULL and IS NULL Created: 2011-07-28 Updated: 2015-02-02 Resolved: 2012-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Philip Stoev (Inactive) | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
Repeatable with maria-5.3,maria-5.2,maria-5.1,mysql-5.1. Not repeatable with mysql-5.5 Having a WHERE t3.a IS NULL in a query causes "NULL" to be returned. The same query without the WHERE returns "19". explain: explain SELECT t3.a FROM t1 LEFT JOIN (( t2 LEFT JOIN t3 ON t2.a = t3.b ) LEFT JOIN t4 ON t3.a = t4.b) ON t1.a = t2.a WHERE t3.a IS NULL;
---
--- test case: CREATE TABLE t1 (a int NOT NULL ); CREATE TABLE t2 (a int NOT NULL ); CREATE TABLE t3 (b int, a int NOT NULL); CREATE TABLE t4 (b int) ; SELECT t3.a FROM t1 LEFT JOIN (( t2 LEFT JOIN t3 ON t2.a = t3.b ) LEFT JOIN t4 ON t3.a = t4.b) ON t1.a = t2.a WHERE t3.a IS NULL; SELECT t3.a FROM t1 LEFT JOIN (( t2 LEFT JOIN t3 ON t2.a = t3.b ) LEFT JOIN t4 ON t3.a = t4.b) ON t1.a = t2.a; |
| Comments |
| Comment by Timour Katchaounov (Inactive) [ 2011-07-28 ] |
|
Re: Wrong result with NOT NULL and IS NULL |
| Comment by Igor Babaev [ 2011-07-30 ] |
|
Re: Wrong result with NOT NULL and IS NULL |
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] |
|
Launchpad bug id: 817360 |