summaryrefslogtreecommitdiffstats
path: root/tests/fixtures/optimizer/merge_subqueries.sql
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fixtures/optimizer/merge_subqueries.sql')
-rw-r--r--tests/fixtures/optimizer/merge_subqueries.sql18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/fixtures/optimizer/merge_subqueries.sql b/tests/fixtures/optimizer/merge_subqueries.sql
index ce5a435..e39e7d1 100644
--- a/tests/fixtures/optimizer/merge_subqueries.sql
+++ b/tests/fixtures/optimizer/merge_subqueries.sql
@@ -446,3 +446,21 @@ SELECT
1 AS a;
WITH q AS (SELECT x.a AS a FROM x AS x ORDER BY x.a) SELECT q.a AS a FROM q AS q UNION ALL SELECT 1 AS a;
+# title: Consecutive inner - outer conflicting names
+WITH tbl AS (select 1 as id)
+SELECT
+ id
+FROM (
+ SELECT OTBL.id
+ FROM (
+ SELECT OTBL.id
+ FROM (
+ SELECT OTBL.id
+ FROM tbl AS OTBL
+ LEFT OUTER JOIN tbl AS ITBL ON OTBL.id = ITBL.id
+ ) AS OTBL
+ LEFT OUTER JOIN tbl AS ITBL ON OTBL.id = ITBL.id
+ ) AS OTBL
+ LEFT OUTER JOIN tbl AS ITBL ON OTBL.id = ITBL.id
+) AS ITBL;
+WITH tbl AS (SELECT 1 AS id) SELECT OTBL.id AS id FROM tbl AS OTBL LEFT OUTER JOIN tbl AS ITBL_2 ON OTBL.id = ITBL_2.id LEFT OUTER JOIN tbl AS ITBL_3 ON OTBL.id = ITBL_3.id LEFT OUTER JOIN tbl AS ITBL ON OTBL.id = ITBL.id;