summaryrefslogtreecommitdiffstats
path: root/tests/fixtures/optimizer/merge_subqueries.sql
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-10-22 17:00:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-10-22 17:00:19 +0000
commit357f4c323239b9ba9b604c444fe3c2e1991e46ec (patch)
tree739aa7ddca96a60c9148554b35bb1b231cb9888f /tests/fixtures/optimizer/merge_subqueries.sql
parentReleasing debian version 25.24.5-1. (diff)
downloadsqlglot-357f4c323239b9ba9b604c444fe3c2e1991e46ec.tar.xz
sqlglot-357f4c323239b9ba9b604c444fe3c2e1991e46ec.zip
Merging upstream version 25.26.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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;