Changeset: dd4db6adb350 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/dd4db6adb350
Added Files:
        sql/test/BugTracker-2026/Tests/7951-exp_visitor-crash.test
Modified Files:
        sql/test/BugTracker-2026/Tests/All
Branch: Dec2025
Log Message:

Add test for #7951


diffs (60 lines):

diff --git a/sql/test/BugTracker-2026/Tests/7951-exp_visitor-crash.test 
b/sql/test/BugTracker-2026/Tests/7951-exp_visitor-crash.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2026/Tests/7951-exp_visitor-crash.test
@@ -0,0 +1,47 @@
+-- query with the 'HAVING NOT - - ( EXISTS ( SELECT 1 ) ) = ANY (...)' part 
disabled, doesn't crash
+query T rowsort
+SELECT COUNT ( * ) = 0 AS x
+ FROM ( SELECT CAST( 55 AS NUMERIC ) AS x
+          FROM ( SELECT 1 AS x ) AS x
+        UNION
+        SELECT 0 AS x GROUP BY ROLLUP ( x )
+        UNION SELECT 3 AS x )
+ WHERE levenshtein ( '\xf4\x8f\xbf\xbf' , 2 , 1 , 1 ) NOT
+  IN (
+      SELECT right_shift ( 8 , 2 )
+       GROUP BY x
+       HAVING avg ( DISTINCT x ) < ROUND ( x , - COUNT ( * ) )
+      EXCEPT
+      SELECT 2 AS x
+      UNION
+      SELECT 3 AS x
+       GROUP BY CUBE ( x , x , x )
+--     HAVING NOT - - ( EXISTS ( SELECT 1 ) ) = ANY ( NOT MAX ( x ) < AVG ( 
'to' ) )
+     )
+----
+False
+
+-- the orginal reported query
+-- it crashes in  exp_visitor (v=0x7fc2be593790, rel=0x7fc2881bf230, 
e=0xdbdbdbdbdbdbdbdb, depth=0, exp_rewriter=0x7fc30f5e03c4 
<exp_reset_card_and_freevar_set_physical_type>, topdown=false, 
relations_topdown=false, visit_relations_once=false, changed=0x7fc2be5932af) at 
sql/server/rel_rel.c:2209
+query T rowsort
+SELECT COUNT ( * ) = 0 AS x
+ FROM ( SELECT CAST( 55 AS NUMERIC ) AS x
+          FROM ( SELECT 1 AS x ) AS x
+        UNION
+        SELECT 0 AS x GROUP BY ROLLUP ( x )
+        UNION SELECT 3 AS x )
+ WHERE levenshtein ( '\xf4\x8f\xbf\xbf' , 2 , 1 , 1 ) NOT
+  IN (
+      SELECT right_shift ( 8 , 2 )
+       GROUP BY x
+       HAVING avg ( DISTINCT x ) < ROUND ( x , - COUNT ( * ) )
+      EXCEPT
+      SELECT 2 AS x
+      UNION
+      SELECT 3 AS x
+       GROUP BY CUBE ( x , x , x )
+       HAVING NOT - - ( EXISTS ( SELECT 1 ) ) = ANY ( NOT MAX ( x ) < AVG ( 
'to' ) )
+     )
+----
+False
+
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
@@ -136,3 +136,4 @@ KNOWNFAIL?7947-exp_bin-crash
 KNOWNFAIL?7948-exp_bin-first_value-crash
 KNOWNFAIL?7949-exp_match-crash
 KNOWNFAIL?7950-exp_set_type-crash
+KNOWNFAIL?7951-exp_visitor-crash
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to