Describe the bug
Queries that use ANY / ALL subquery comparisons fail at planning time with an internal schema error instead of executing.
To Reproduce
CREATE TABLE person(id INT, age INT);
INSERT INTO person VALUES (1, 20), (2, 30), (3, 40);
-- (1) ANY
SELECT id FROM person WHERE age = ANY (SELECT age FROM person);
-- (2) ALL
SELECT id FROM person WHERE age <> ALL (SELECT age FROM person);
Both queries fail at planning time with:
Optimizer rule 'optimize_projections' failed
caused by
Schema error: Schema contains duplicate unqualified field name mark
Expected behavior
ANY: age = ANY (SELECT age FROM person) is true for every row (each row's age is in the set {20, 30, 40}). Expected output: ids 1, 2, 3.
ALL: age <> ALL (SELECT age FROM person) is false for every row. Expected output: zero rows.
Additional context
No response
Describe the bug
Queries that use
ANY/ALLsubquery comparisons fail at planning time with an internal schema error instead of executing.To Reproduce
Both queries fail at planning time with:
Expected behavior
ANY:age = ANY (SELECT age FROM person)is true for every row (each row's age is in the set {20, 30, 40}). Expected output: ids 1, 2, 3.ALL:age <> ALL (SELECT age FROM person)is false for every row. Expected output: zero rows.Additional context
No response