Details
Description
Description
MariaDB Server 12.3.2 cannot resolve an outer query's table alias in a correlated SELECT inside a parenthesized INTERSECT operand of UNION. The outer alias is visible to an equivalent flat UNION branch and to a non-nested INTERSECT.
This report concerns a correlated SELECT in WHERE EXISTS. The reproduction does not place an outer reference inside a FROM-derived table that would require LATERAL.
How to repeat
 |
SELECT o.a
|
FROM (SELECT 1 AS a UNION ALL SELECT 2) AS o |
WHERE EXISTS (
|
SELECT 0 WHERE FALSE |
UNION
|
(SELECT 1 WHERE o.a = 1 INTERSECT SELECT 1) |
);
|
Actual result
ERROR 1109 (42S02): Unknown table 'o' in WHERE |