From 57c3067868d0a1da90ec0f2201dd91f031241274 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel.baumann@progress-linux.org>
Date: Sun, 19 Mar 2023 11:22:04 +0100
Subject: Adding upstream version 11.4.1.

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

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

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;
-- 
cgit v1.2.3

