summaryrefslogtreecommitdiffstats
path: root/tests/fixtures
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-05 18:41:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-05 18:41:12 +0000
commit7ff5bab54e3298dd89132706f6adee17f5164f6d (patch)
tree9b5896df787dbce648aa95d02c5c15ff34beb1c6 /tests/fixtures
parentReleasing debian version 9.0.3-1. (diff)
downloadsqlglot-7ff5bab54e3298dd89132706f6adee17f5164f6d.tar.xz
sqlglot-7ff5bab54e3298dd89132706f6adee17f5164f6d.zip
Merging upstream version 9.0.6.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/fixtures')
-rw-r--r--tests/fixtures/optimizer/qualify_columns.sql17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/fixtures/optimizer/qualify_columns.sql b/tests/fixtures/optimizer/qualify_columns.sql
index 858f232..a958c08 100644
--- a/tests/fixtures/optimizer/qualify_columns.sql
+++ b/tests/fixtures/optimizer/qualify_columns.sql
@@ -31,6 +31,23 @@ SELECT x.a + x.b AS "_col_0" FROM x AS x;
SELECT a, SUM(b) FROM x WHERE a > 1 AND b > 1 GROUP BY a;
SELECT x.a AS a, SUM(x.b) AS "_col_1" FROM x AS x WHERE x.a > 1 AND x.b > 1 GROUP BY x.a;
+SELECT SUM(a) AS c FROM x HAVING SUM(a) > 3;
+SELECT SUM(x.a) AS c FROM x AS x HAVING SUM(x.a) > 3;
+
+SELECT SUM(a) AS a FROM x HAVING SUM(a) > 3;
+SELECT SUM(x.a) AS a FROM x AS x HAVING SUM(x.a) > 3;
+
+SELECT SUM(a) AS c FROM x HAVING c > 3;
+SELECT SUM(x.a) AS c FROM x AS x HAVING c > 3;
+
+# execute: false
+SELECT SUM(a) AS a FROM x HAVING a > 3;
+SELECT SUM(x.a) AS a FROM x AS x HAVING a > 3;
+
+# execute: false
+SELECT SUM(a) AS c FROM x HAVING SUM(c) > 3;
+SELECT SUM(x.a) AS c FROM x AS x HAVING SUM(c) > 3;
+
SELECT a AS j, b FROM x ORDER BY j;
SELECT x.a AS j, x.b AS b FROM x AS x ORDER BY j;