From 3742f86d166160ca3843872ebecb6f30c51f6085 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel.baumann@progress-linux.org>
Date: Mon, 14 Aug 2023 12:12:19 +0200
Subject: Merging upstream version 17.12.0.

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

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

diff --git a/tests/fixtures/optimizer/simplify.sql b/tests/fixtures/optimizer/simplify.sql
index f821575..3ed02cd 100644
--- a/tests/fixtures/optimizer/simplify.sql
+++ b/tests/fixtures/optimizer/simplify.sql
@@ -240,9 +240,18 @@ A AND B AND C;
 SELECT x WHERE TRUE;
 SELECT x;
 
-SELECT x FROM y LEFT JOIN z ON TRUE;
+SELECT x FROM y JOIN z ON TRUE;
+SELECT x FROM y CROSS JOIN z;
+
+SELECT x FROM y RIGHT JOIN z ON TRUE;
 SELECT x FROM y CROSS JOIN z;
 
+SELECT x FROM y LEFT JOIN z ON TRUE;
+SELECT x FROM y LEFT JOIN z ON TRUE;
+
+SELECT x FROM y FULL OUTER JOIN z ON TRUE;
+SELECT x FROM y FULL OUTER JOIN z ON TRUE;
+
 SELECT x FROM y JOIN z USING (x);
 SELECT x FROM y JOIN z USING (x);
 
@@ -602,3 +611,57 @@ TRUE;
 
 x = 2018 OR x <> 2018;
 x <> 2018 OR x = 2018;
+
+--------------------------------------
+-- Coalesce
+--------------------------------------
+COALESCE(x);
+x;
+
+COALESCE(x, 1) = 2;
+x = 2 AND NOT x IS NULL;
+
+2 = COALESCE(x, 1);
+2 = x AND NOT x IS NULL;
+
+COALESCE(x, 1, 1) = 1 + 1;
+x = 2 AND NOT x IS NULL;
+
+COALESCE(x, 1, 2) = 2;
+x = 2 AND NOT x IS NULL;
+
+COALESCE(x, 3) <= 2;
+x <= 2 AND NOT x IS NULL;
+
+COALESCE(x, 1) <> 2;
+x <> 2 OR x IS NULL;
+
+COALESCE(x, 1) <= 2;
+x <= 2 OR x IS NULL;
+
+COALESCE(x, 1) = 1;
+x = 1 OR x IS NULL;
+
+COALESCE(x, 1) IS NULL;
+FALSE;
+
+--------------------------------------
+-- CONCAT
+--------------------------------------
+CONCAT(x, y);
+CONCAT(x, y);
+
+CONCAT(x);
+x;
+
+CONCAT('a', 'b', 'c');
+'abc';
+
+CONCAT('a', x, y, 'b', 'c');
+CONCAT('a', x, y, 'bc');
+
+'a' || 'b';
+'ab';
+
+'a' || 'b' || x;
+CONCAT('ab', x);
-- 
cgit v1.2.3

