Bug #119100 WHERE alias IS NULL Fails for Derived Column Using subquery
| Submitted: | 1 Oct 2025 1:00 | Modified: | 2 Apr 6:17 |
|---|---|---|---|
| Reporter: | Runyuan He | Email Updates: | |
| Status: | Duplicate | Impact on me: | |
| Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
| Version: | 9.4.0 | OS: | Linux |
| Assigned to: | CPU Architecture: | x86 |
[6 Oct 2025 4:17]
Chaithra Marsur Gopala Reddy
Hi Runyuan He, Thank you for the bug report. Verified as described.
[2 Apr 6:17]
Chaithra Marsur Gopala Reddy
This is identified as duplicate of https://bugs.mysql.com/bug.php?id=119780
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.050 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: A WHERE alias IS NULL clause on a derived table column produces an incorrect empty set. This occurs when the column is defined with a (NULL) OR (column) expression and another correlated subquery is also present in the SELECT list of the derived table. How to repeat: CREATE TABLE t1(c1 VARCHAR(500)); INSERT INTO t1 VALUES ('a'); SELECT sub.p0 FROM ( SELECT (NULL) OR (t1.c1) AS p0, (SELECT x FROM (SELECT t1.c1 AS x) AS u) AS p1 FROM t1 ) AS sub; -- NULL, Correct SELECT sub.p0 FROM ( SELECT (NULL) OR (t1.c1) AS p0, (SELECT x FROM (SELECT t1.c1 AS x) AS u) AS p1 FROM t1 ) AS sub WHERE sub.p0 IS NULL; -- Empty set, Wrong