diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-03-19 10:22:04 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-03-19 10:22:04 +0000 |
commit | 57c3067868d0a1da90ec0f2201dd91f031241274 (patch) | |
tree | 3b16819683e27ccbc7e7726675ab8d3e978fc8aa /tests/fixtures/optimizer/canonicalize.sql | |
parent | Adding upstream version 11.3.6. (diff) | |
download | sqlglot-57c3067868d0a1da90ec0f2201dd91f031241274.tar.xz sqlglot-57c3067868d0a1da90ec0f2201dd91f031241274.zip |
Adding upstream version 11.4.1.upstream/11.4.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/fixtures/optimizer/canonicalize.sql')
-rw-r--r-- | tests/fixtures/optimizer/canonicalize.sql | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/fixtures/optimizer/canonicalize.sql b/tests/fixtures/optimizer/canonicalize.sql index 8c7cd45..50fee7f 100644 --- a/tests/fixtures/optimizer/canonicalize.sql +++ b/tests/fixtures/optimizer/canonicalize.sql @@ -9,3 +9,19 @@ SELECT CAST(1 AS VARCHAR) AS "a" FROM "w" AS "w"; SELECT CAST(1 + 3.2 AS DOUBLE) AS a FROM w AS w; SELECT 1 + 3.2 AS "a" FROM "w" AS "w"; + +-------------------------------------- +-- Ensure boolean predicates +-------------------------------------- + +SELECT a FROM x WHERE b; +SELECT "x"."a" AS "a" FROM "x" AS "x" WHERE "x"."b" <> 0; + +SELECT a FROM x GROUP BY a HAVING SUM(b); +SELECT "x"."a" AS "a" FROM "x" AS "x" GROUP BY "x"."a" HAVING SUM("x"."b") <> 0; + +SELECT a FROM x GROUP BY a HAVING SUM(b) AND TRUE; +SELECT "x"."a" AS "a" FROM "x" AS "x" GROUP BY "x"."a" HAVING SUM("x"."b") <> 0 AND TRUE; + +SELECT a FROM x WHERE 1; +SELECT "x"."a" AS "a" FROM "x" AS "x" WHERE 1 <> 0; |