You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Duplicate subqueries produce incorrect results #21210
CREATE TABLE t1(id INTEGER) AS VALUES (1), (2), (3);
CREATE TABLE t2(id INTEGER, outer_id INTEGER) AS VALUES (10, 1), (20, 1), (30, 2);
SELECT
(SELECT count(*) AS c FROM t2 WHERE t2.outer_id = t1.id) + 1 AS a,
(SELECT count(*) AS c FROM t2 WHERE t2.outer_id = t1.id) + 2 AS b
FROM t1
ORDER BY t1.id;
Activity
neilconway commentedon Mar 28, 2026
take
fix: Fix bug with structurally equal correlated subqueries (apache#22313