From 38e6461a8afbd7cb83709ddb998f03d40ba87755 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel.baumann@progress-linux.org>
Date: Tue, 23 Jan 2024 06:06:14 +0100
Subject: Merging upstream version 20.9.0.

Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
---
 tests/fixtures/optimizer/qualify_columns.sql | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

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

diff --git a/tests/fixtures/optimizer/qualify_columns.sql b/tests/fixtures/optimizer/qualify_columns.sql
index 43127a9..5641ed4 100644
--- a/tests/fixtures/optimizer/qualify_columns.sql
+++ b/tests/fixtures/optimizer/qualify_columns.sql
@@ -153,7 +153,7 @@ SELECT AGGREGATE(ARRAY(x.a, x.b), 0, (x, acc) -> x + acc + x.a) AS sum_agg FROM
 # dialect: starrocks
 # execute: false
 SELECT DATE_TRUNC('week', a) AS a FROM x;
-SELECT DATE_TRUNC('week', x.a) AS a FROM x AS x;
+SELECT DATE_TRUNC('WEEK', x.a) AS a FROM x AS x;
 
 # dialect: bigquery
 # execute: false
@@ -276,6 +276,17 @@ SELECT _q_0.a AS a FROM (SELECT x.a AS a FROM x AS x) AS _q_0;
 SELECT * FROM x GROUP BY 1, 2;
 SELECT x.a AS a, x.b AS b FROM x AS x GROUP BY x.a, x.b;
 
+SELECT * FROM (SELECT * FROM x) AS s(a, b);
+SELECT s.a AS a, s.b AS b FROM (SELECT x.a AS a, x.b AS b FROM x AS x) AS s;
+
+# execute: false
+SELECT * FROM (SELECT * FROM t) AS s(a, b);
+SELECT s.a AS a, s.b AS b FROM (SELECT t.a AS a, t.b AS b FROM t AS t) AS s;
+
+# execute: false
+SELECT * FROM (SELECT * FROM t1 UNION ALL SELECT * FROM t2) AS s(b);
+SELECT s.b AS b FROM (SELECT t1.b AS b FROM t1 AS t1 UNION ALL SELECT t2.b AS b FROM t2 AS t2) AS s;
+
 --------------------------------------
 -- CTEs
 --------------------------------------
@@ -430,6 +441,16 @@ SELECT t.aa AS aa FROM x AS x, UNNEST(x.a) AS t(aa);
 SELECT aa FROM x, UNNEST(a) AS aa;
 SELECT aa AS aa FROM x AS x, UNNEST(x.a) AS aa;
 
+# dialect: bigquery
+# execute: false
+select * from unnest ([1, 2]) as x with offset;
+SELECT x AS x, offset AS offset FROM UNNEST([1, 2]) AS x WITH OFFSET AS offset;
+
+# dialect: bigquery
+# execute: false
+select * from unnest ([1, 2]) as x with offset as y;
+SELECT x AS x, y AS y FROM UNNEST([1, 2]) AS x WITH OFFSET AS y;
+
 # dialect: presto
 SELECT x.a, i.b FROM x CROSS JOIN UNNEST(SPLIT(b, ',')) AS i(b);
 SELECT x.a AS a, i.b AS b FROM x AS x CROSS JOIN UNNEST(SPLIT(x.b, ',')) AS i(b);
-- 
cgit v1.2.3

