summaryrefslogtreecommitdiffstats
path: root/tests/fixtures
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-11 12:13:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-11 12:13:38 +0000
commite894f65cf8a2e3c88439e1b06d8542b969e2bc3f (patch)
treedb0e8e728b297f06d7ad5a6034e8110bae97297e /tests/fixtures
parentReleasing debian version 25.18.0-1. (diff)
downloadsqlglot-e894f65cf8a2e3c88439e1b06d8542b969e2bc3f.tar.xz
sqlglot-e894f65cf8a2e3c88439e1b06d8542b969e2bc3f.zip
Merging upstream version 25.20.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/fixtures')
-rw-r--r--tests/fixtures/identity.sql3
-rw-r--r--tests/fixtures/optimizer/annotate_types.sql14
-rw-r--r--tests/fixtures/optimizer/optimizer.sql2
-rw-r--r--tests/fixtures/pretty.sql13
4 files changed, 29 insertions, 3 deletions
diff --git a/tests/fixtures/identity.sql b/tests/fixtures/identity.sql
index 20cbe7f..013eed8 100644
--- a/tests/fixtures/identity.sql
+++ b/tests/fixtures/identity.sql
@@ -596,6 +596,7 @@ CREATE TABLE customer (pk BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (CYCLE))
CREATE TABLE customer (period INT NOT NULL)
CREATE TABLE foo (baz_id INT REFERENCES baz (id) DEFERRABLE)
CREATE TABLE foo (baz CHAR(4) CHARACTER SET LATIN UPPERCASE NOT CASESPECIFIC COMPRESS 'a')
+CREATE TABLE db.foo (id INT NOT NULL, valid_date DATE FORMAT 'YYYY-MM-DD', measurement INT COMPRESS)
CREATE TABLE foo (baz DATE FORMAT 'YYYY/MM/DD' TITLE 'title' INLINE LENGTH 1 COMPRESS ('a', 'b'))
CREATE TABLE t (title TEXT)
CREATE TABLE foo (baz INT, inline TEXT)
@@ -877,4 +878,4 @@ SELECT * FROM a STRAIGHT_JOIN b
SELECT COUNT(DISTINCT "foo bar") FROM (SELECT 1 AS "foo bar") AS t
SELECT vector
WITH all AS (SELECT 1 AS count) SELECT all.count FROM all
-SELECT rename \ No newline at end of file
+SELECT rename
diff --git a/tests/fixtures/optimizer/annotate_types.sql b/tests/fixtures/optimizer/annotate_types.sql
index 0a5fc22..f608851 100644
--- a/tests/fixtures/optimizer/annotate_types.sql
+++ b/tests/fixtures/optimizer/annotate_types.sql
@@ -1,13 +1,25 @@
5;
INT;
+-5;
+INT;
+
+~5;
+INT;
+
+(5);
+INT;
+
5.3;
DOUBLE;
'bla';
VARCHAR;
-True;
+true;
+bool;
+
+not true;
bool;
false;
diff --git a/tests/fixtures/optimizer/optimizer.sql b/tests/fixtures/optimizer/optimizer.sql
index c5f8a4f..76fc16d 100644
--- a/tests/fixtures/optimizer/optimizer.sql
+++ b/tests/fixtures/optimizer/optimizer.sql
@@ -838,7 +838,7 @@ SELECT
FROM `bigquery-public-data.GooGle_tReNDs.TOp_TeRmS` AS `TOp_TeRmS`
WHERE
`TOp_TeRmS`.`rank` = 1
- AND `TOp_TeRmS`.`refresh_date` >= DATE_SUB(CURRENT_DATE, INTERVAL 2 WEEK)
+ AND `TOp_TeRmS`.`refresh_date` >= DATE_SUB(CURRENT_DATE, INTERVAL '2' WEEK)
GROUP BY
`day`,
`top_term`,
diff --git a/tests/fixtures/pretty.sql b/tests/fixtures/pretty.sql
index 8e10517..3e5619a 100644
--- a/tests/fixtures/pretty.sql
+++ b/tests/fixtures/pretty.sql
@@ -405,3 +405,16 @@ JOIN b
'eeeeeeeeeeeeeeeeeeeee'
);
+/* COMMENT */
+INSERT FIRST WHEN salary > 4000 THEN INTO emp2
+ WHEN salary > 5000 THEN INTO emp3
+ WHEN salary > 6000 THEN INTO emp4
+SELECT salary FROM employees;
+/* COMMENT */
+INSERT FIRST
+ WHEN salary > 4000 THEN INTO emp2
+ WHEN salary > 5000 THEN INTO emp3
+ WHEN salary > 6000 THEN INTO emp4
+SELECT
+ salary
+FROM employees;