Changeset: 1bb53d01e6ed for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1bb53d01e6ed
Added Files:
        sql/test/BugTracker-2026/Tests/7904-sum-case-and-bug.test
Modified Files:
        sql/test/BugTracker-2026/Tests/All
Branch: Dec2025
Log Message:

Add missing test for #7904


diffs (63 lines):

diff --git a/sql/test/BugTracker-2026/Tests/7904-sum-case-and-bug.test 
b/sql/test/BugTracker-2026/Tests/7904-sum-case-and-bug.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2026/Tests/7904-sum-case-and-bug.test
@@ -0,0 +1,47 @@
+-- SCHEMA
+
+statement ok
+CREATE TABLE comments7904 (
+    id          INT,
+    post_id     INT,
+    user_id     INT,
+    content     VARCHAR(1000),
+    is_spam     INT,
+    created_at  TIMESTAMP
+)
+
+statement ok rowcount 4
+INSERT INTO comments7904 VALUES
+(1, 1, 2, 'Nice post', 0, '2022-01-20 10:00:00'),
+(2, 1, 3, 'Spam here', 1,  '2022-01-21 11:00:00'),
+(3, 2, 1, 'Thanks',    0, '2022-01-22 12:00:00'),
+(4, 4, 5, NULL,        0, '2022-01-23 13:00:00')
+
+-- RESULT: {0}
+query I nosort
+SELECT COUNT(*)
+FROM comments7904 AS ref_0
+WHERE (
+    LTRIM('dbb') <= '8e'
+    AND ref_0.user_id IS NOT NULL
+)
+----
+0
+
+-- RESULT was: {4} wrong!
+query I nosort
+SELECT SUM(
+    CASE
+        WHEN (
+            LTRIM('dbb') <= '8e'
+            AND ref_0.user_id IS NOT NULL
+        )
+        THEN 1 ELSE 0
+    END + 0
+)
+FROM comments7904 AS ref_0
+----
+0
+
+statement ok
+DROP TABLE comments7904
diff --git a/sql/test/BugTracker-2026/Tests/All 
b/sql/test/BugTracker-2026/Tests/All
--- a/sql/test/BugTracker-2026/Tests/All
+++ b/sql/test/BugTracker-2026/Tests/All
@@ -100,6 +100,7 @@ KNOWNFAIL?7774-insert-into-renamed-table
 7901-sum-case-and-or-bug
 7902-sum-case-and-bug
 7903-query-without-result-bug
+7904-sum-case-and-bug
 7905-sum-case-subquery-bug
 7906-rel2bin_join-assertion-failure
 7910-where-case-when-and-bug
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to