From 28cc22419e32a65fea2d1678400265b8cabc3aff Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel.baumann@progress-linux.org>
Date: Thu, 15 Sep 2022 18:46:17 +0200
Subject: Adding upstream version 6.0.4.

Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
---
 tests/fixtures/optimizer/eliminate_subqueries.sql | 42 +++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 tests/fixtures/optimizer/eliminate_subqueries.sql

(limited to 'tests/fixtures/optimizer/eliminate_subqueries.sql')

diff --git a/tests/fixtures/optimizer/eliminate_subqueries.sql b/tests/fixtures/optimizer/eliminate_subqueries.sql
new file mode 100644
index 0000000..aae5f2a
--- /dev/null
+++ b/tests/fixtures/optimizer/eliminate_subqueries.sql
@@ -0,0 +1,42 @@
+SELECT 1 AS x, 2 AS y
+UNION ALL
+SELECT 1 AS x, 2 AS y;
+WITH _e_0 AS (
+  SELECT
+    1 AS x,
+    2 AS y
+)
+SELECT
+  *
+FROM _e_0
+UNION ALL
+SELECT
+  *
+FROM _e_0;
+
+SELECT x.id
+FROM (
+    SELECT *
+    FROM x AS x
+    JOIN y AS y
+      ON x.id = y.id
+) AS x
+JOIN (
+    SELECT *
+    FROM x AS x
+    JOIN y AS y
+      ON x.id = y.id
+) AS y
+ON x.id = y.id;
+WITH _e_0 AS (
+  SELECT
+    *
+  FROM x AS x
+  JOIN y AS y
+    ON x.id = y.id
+)
+SELECT
+  x.id
+FROM "_e_0" AS x
+JOIN "_e_0" AS y
+  ON x.id = y.id;
-- 
cgit v1.2.3

