Changeset: 20498fd9604b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/20498fd9604b
Added Files:
        
sql/test/BugTracker-2026/Tests/7997-recursive-cte-number-overflow-issue.test
Modified Files:
        sql/test/BugTracker-2026/Tests/All
Branch: Dec2025
Log Message:

Add test for issue #7997


diffs (33 lines):

diff --git 
a/sql/test/BugTracker-2026/Tests/7997-recursive-cte-number-overflow-issue.test 
b/sql/test/BugTracker-2026/Tests/7997-recursive-cte-number-overflow-issue.test
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2026/Tests/7997-recursive-cte-number-overflow-issue.test
@@ -0,0 +1,20 @@
+-- MonetDB:    22003!overflow in calculation 127+1.
+-- PostgreSQL & DuckDB & SQLite all return: 200
+query I nosort
+WITH RECURSIVE r(n) AS (SELECT 1 UNION ALL SELECT n+1 FROM r WHERE n < 200) 
SELECT MAX(n) FROM r
+----
+200
+
+-- Casting the SEED to INTEGER fixes it (confirms the root cause is seed-type 
inference):
+-- MonetDB:    200   (correct)
+query I nosort
+WITH RECURSIVE r(n) AS (SELECT CAST(1 AS INTEGER) UNION ALL SELECT n+1 FROM r 
WHERE n < 200) SELECT MAX(n) FROM r
+----
+200
+
+-- extra check to test what happens when we start from 128, so type tinyint is 
not possible.
+query I nosort
+WITH RECURSIVE r(n) AS (SELECT 128 UNION ALL SELECT n+1 FROM r WHERE n < 200) 
SELECT MAX(n) FROM r
+----
+200
+
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
@@ -177,3 +177,4 @@ KNOWNFAIL?7993-query-groupby-rollup-bug
 KNOWNFAIL?7994-exists-groupby-rollup-bug
 KNOWNFAIL?7995-left-join-lateral-subquery-bug
 KNOWNFAIL?7996-delete-not-exists-correlated-query-bug
+KNOWNFAIL?7997-recursive-cte-number-overflow-issue
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to