From f1c2dbe3b17a0d5edffbb65b85b642d0bb2756c5 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel.baumann@progress-linux.org>
Date: Tue, 19 Dec 2023 12:01:55 +0100
Subject: Merging upstream version 20.3.0.

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

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

diff --git a/tests/fixtures/optimizer/unnest_subqueries.sql b/tests/fixtures/optimizer/unnest_subqueries.sql
index e78bed0..f83191d 100644
--- a/tests/fixtures/optimizer/unnest_subqueries.sql
+++ b/tests/fixtures/optimizer/unnest_subqueries.sql
@@ -24,6 +24,7 @@ WHERE
   AND x.a = (SELECT SUM(y.c) AS c FROM y WHERE y.a = x.a OFFSET 10)
   AND x.a > ALL (SELECT y.c FROM y WHERE y.a = x.a)
   AND x.a > (SELECT COUNT(*) as d FROM y WHERE y.a = x.a)
+  AND x.a = SUM(SELECT 1)  -- invalid statement left alone
 ;
 SELECT
   *
@@ -208,7 +209,10 @@ WHERE
     OFFSET 10
   )
   AND ARRAY_ALL(_u_19."", _x -> _x = x.a)
-  AND x.a > COALESCE(_u_21.d, 0);
+  AND x.a > COALESCE(_u_21.d, 0)
+  AND x.a = SUM(SELECT
+    1) /* invalid statement left alone */
+;
 SELECT
   CAST((
     SELECT
-- 
cgit v1.2.3

