summaryrefslogtreecommitdiffstats
path: root/tests/fixtures/optimizer/optimizer.sql
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fixtures/optimizer/optimizer.sql')
-rw-r--r--tests/fixtures/optimizer/optimizer.sql15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/fixtures/optimizer/optimizer.sql b/tests/fixtures/optimizer/optimizer.sql
index a1e531b..a692c7d 100644
--- a/tests/fixtures/optimizer/optimizer.sql
+++ b/tests/fixtures/optimizer/optimizer.sql
@@ -276,3 +276,18 @@ SELECT /*+ COALESCE(3),
FROM `x` AS `x`
JOIN `y` AS `y`
ON `x`.`b` = `y`.`b`;
+
+WITH cte1 AS (
+ WITH cte2 AS (
+ SELECT a, b FROM x
+ )
+ SELECT a1
+ FROM (
+ WITH cte3 AS (SELECT 1)
+ SELECT a AS a1, b AS b1 FROM cte2
+ )
+)
+SELECT a1 FROM cte1;
+SELECT
+ "x"."a" AS "a1"
+FROM "x" AS "x";