Changeset: cf05601905d8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/cf05601905d8
Modified Files:
        gdk/gdk_storage.c
        sql/test/BugTracker-2026/Tests/All
Branch: default
Log Message:

Merge with Dec2025 branch.


diffs (truncated from 683 to 300 lines):

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,6 +75,14 @@ endif()
 monetdb_configure_sizes()
 
 include(GNUInstallDirs)
+# work around FreeBSD forcing CMAKE_INSTALL_FULL_LOCALSTATEDIR to /var
+# we keep whatever FreeBSD comes up with (/var) if the prefix is / or
+# starts with /usr or /opt, but for other prefixes (e.g. home directory)
+# we set the variable to prefix + var.
+if(CMAKE_SYSTEM_NAME MATCHES "^FreeBSD$" AND NOT "${CMAKE_INSTALL_PREFIX}" 
STREQUAL "/" AND NOT "${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr$" AND NOT 
"${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/" AND NOT "${CMAKE_INSTALL_PREFIX}" 
MATCHES "^/opt/")
+  set(CMAKE_INSTALL_FULL_LOCALSTATEDIR 
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LOCALSTATEDIR}")
+endif()
+
 # The documentation is unclear on what is the best location to install
 # the configuration for the exported targets, especially when building
 # the packages (deb/rpm). For now set the variable to a reasonable value
diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
@@ -375,10 +375,13 @@ GDKextendf(int fd, size_t size, const ch
 #ifdef HAVE_POSIX_FALLOCATE
                /* posix_fallocate returns error number on failure,
                 * not -1 :-( */
-               if ((rt = posix_fallocate(fd, stb.st_size, (off_t) size - 
stb.st_size)) == EINVAL)
-                       /* on Solaris/OpenIndiana, this may mean that
-                        * the underlying file system doesn't support
-                        * the operation, so just resize the file */
+               rt = posix_fallocate(fd, stb.st_size, (off_t) size - 
stb.st_size);
+               if (rt != 0)
+                       errno = rt;
+               if (rt == EINVAL || rt == EOPNOTSUPP)
+                       /* some systems seem to return EINVAL and others
+                        * EOPNOTSUPP if the file system doesn't support
+                        * this operation */
 #endif
 #endif
                        /* we get here when (posix_)fallocate fails
diff --git a/sql/test/BugTracker-2026/Tests/7883-right-join-crash.test 
b/sql/test/BugTracker-2026/Tests/7883-right-join-crash.test
--- a/sql/test/BugTracker-2026/Tests/7883-right-join-crash.test
+++ b/sql/test/BugTracker-2026/Tests/7883-right-join-crash.test
@@ -23,7 +23,7 @@ INSERT INTO users VALUES
 (4, 'dave',  '[email protected]',  45, 'active',  '2022-01-04 13:00:00', 65.2),
 (5, NULL,    '[email protected]',  18, 'inactive','2022-01-05 14:00:00', 70.0)
 
-query I
+query I rowsort
 select 1
 from
   users
@@ -40,6 +40,9 @@ where true
 ----
 
 statement ok
+drop table users
+
+statement ok
 CREATE TABLE posts (
     id          INT,
     user_id     INT,
@@ -77,8 +80,7 @@ INSERT INTO orders VALUES
 (5, 5, 999.99, 'paid',    '2022-02-05 13:00:00')
 
 -- Crash SQL
-
-query I
+query I rowsort
 select 1
 from
   posts as ref_0,
@@ -96,65 +98,14 @@ where false
 ----
 
 statement ok
-drop table users
-
-statement ok
 drop table posts
 
 statement ok
 drop table orders
 
 statement ok
-CREATE TABLE users (
-    id           INT,
-    username     VARCHAR(100),
-    email        VARCHAR(255),
-    age          INT,
-    status       VARCHAR(20),
-    created_at   TIMESTAMP,
-    score        DOUBLE
-)
+SET SCHEMA sys
 
 statement ok
-CREATE TABLE orders (
-    id          INT,
-    user_id     INT,
-    amount      DOUBLE,
-    status      VARCHAR(20),
-    created_at  TIMESTAMP
-)
-
-statement ok rowcount 5
-INSERT INTO users VALUES
-(1, 'alice', '[email protected]', 20, 'active',  '2022-01-01 10:00:00', 88.5),
-(2, 'bob',   '[email protected]',   30, 'active',  '2022-01-02 11:00:00', 92.3),
-(3, 'carol', NULL,             NULL, 'banned','2022-01-03 12:00:00', NULL),
-(4, 'dave',  '[email protected]',  45, 'active',  '2022-01-04 13:00:00', 65.2),
-(5, NULL,    '[email protected]',  18, 'inactive','2022-01-05 14:00:00', 70.0)
+DROP SCHEMA test7883
 
-statement ok rowcount 5
-INSERT INTO orders VALUES
-(1, 1, 100.00, 'paid',    '2022-02-01 09:00:00'),
-(2, 1, 200.50, 'shipped', '2022-02-02 10:00:00'),
-(3, 2, NULL,   'failed',  '2022-02-03 11:00:00'),
-(4, 3, 50.00,  'paid',    '2022-02-04 12:00:00'),
-(5, 5, 999.99, 'paid',    '2022-02-05 13:00:00')
-
-query I
-select count(*)
-from
-  (select 1
-        from
-          orders as ref_0
-        where true) as subq_0
-    right join orders as ref_1
-        right join users as ref_2
-          inner join orders as ref_3
-          on (true)
-        on (false)
-    on (true )
-where ((true)
-    and (55.85 != 55.45))
-  or (true AND true)
-----
-125
diff --git 
a/sql/test/BugTracker-2026/Tests/7885-right-join-where-true-crash.test 
b/sql/test/BugTracker-2026/Tests/7885-right-join-where-true-crash.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2026/Tests/7885-right-join-where-true-crash.test
@@ -0,0 +1,75 @@
+statement ok
+CREATE SCHEMA test7885
+
+statement ok
+SET SCHEMA test7885
+
+-- Schema
+statement ok
+CREATE TABLE users (
+    id           INT,
+    username     VARCHAR(100),
+    email        VARCHAR(255),
+    age          INT,
+    status       VARCHAR(20),
+    created_at   TIMESTAMP,
+    score        DOUBLE
+)
+
+statement ok
+CREATE TABLE orders (
+    id          INT,
+    user_id     INT,
+    amount      DOUBLE,
+    status      VARCHAR(20),
+    created_at  TIMESTAMP
+)
+
+statement ok rowcount 5
+INSERT INTO users VALUES
+(1, 'alice', '[email protected]', 20, 'active',  '2022-01-01 10:00:00', 88.5),
+(2, 'bob',   '[email protected]',   30, 'active',  '2022-01-02 11:00:00', 92.3),
+(3, 'carol', NULL,             NULL, 'banned','2022-01-03 12:00:00', NULL),
+(4, 'dave',  '[email protected]',  45, 'active',  '2022-01-04 13:00:00', 65.2),
+(5, NULL,    '[email protected]',  18, 'inactive','2022-01-05 14:00:00', 70.0)
+
+statement ok rowcount 5
+INSERT INTO orders VALUES
+(1, 1, 100.00, 'paid',    '2022-02-01 09:00:00'),
+(2, 1, 200.50, 'shipped', '2022-02-02 10:00:00'),
+(3, 2, NULL,   'failed',  '2022-02-03 11:00:00'),
+(4, 3, 50.00,  'paid',    '2022-02-04 12:00:00'),
+(5, 5, 999.99, 'paid',    '2022-02-05 13:00:00')
+
+-- Crash SQL
+query I nosort
+select count(*) as count
+from
+  (select 1
+        from
+          orders as ref_0
+        where true) as subq_0
+    right join orders as ref_1
+        right join users as ref_2
+          inner join orders as ref_3
+          on (true)
+        on (false)
+    on (true )
+where ((true)
+    and (55.85 != 55.45))
+  or (true AND true)
+----
+125
+
+statement ok
+drop table users
+
+statement ok
+drop table orders
+
+statement ok
+SET SCHEMA sys
+
+statement ok
+DROP SCHEMA test7885
+
diff --git a/sql/test/BugTracker-2026/Tests/8024-MALoptimizer-bug.test 
b/sql/test/BugTracker-2026/Tests/8024-MALoptimizer-bug.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2026/Tests/8024-MALoptimizer-bug.test
@@ -0,0 +1,66 @@
+statement ok
+CREATE TABLE b2(c0 BOOLEAN, c1 BOOLEAN)
+
+statement ok rowcount 2
+INSERT INTO b2 VALUES (true,false),(false,true)
+
+query I nosort
+SELECT count(*) FROM b2 WHERE (c0 LIKE c0)
+----
+2
+
+query I nosort
+SELECT count(*) FROM b2 WHERE (NOT (c0 AND c1))
+----
+2
+
+-- next query fails with: 42000!Error in optimizer defaultpipe: 
TypeException:user.main[17]:'calc.or' undefined in:     X_111:any := 
calc.or(X_107:bit, X_109:oid);
+-- createExceptionInternal: ERROR: MALException:defaultpipe:42000!Error in 
optimizer defaultpipe: TypeException:user.main[17]:'calc.or' undefined in:     
X_111:any := calc.or(X_107:bit, X_109:oid);
+query I nosort
+SELECT count(*) FROM b2 WHERE (c0 LIKE c0) = (NOT (c0 AND c1))
+----
+2
+
+query T nosort
+EXPLAIN SELECT count(*) FROM b2 WHERE (c0 LIKE c0) = (NOT (c0 AND c1))
+----
+project (
+| group by (
+| | select (
+| | | table("sys"."b2") [ "b2"."c0", "b2"."c1" ]
+| | ) [ ((varchar["b2"."c0"]) FILTER "sys"."like"(varchar["b2"."c0"], varchar 
"", boolean(1) "false")) = ( !.AND("b2"."c0", "b2"."c1")) ]
+| ) [  ] [ "sys"."count"() as "%1"."%1" ]
+) [ "%1"."%1" ]
+
+-- next query fails with: 42000!Error in optimizer defaultpipe: 
TypeException:user.main[17]:'calc.or' undefined in:     X_111:any := 
calc.or(X_107:bit, X_109:oid);
+query T nosort
+EXPLAIN PHYSICAL SELECT count(*) FROM b2 WHERE (c0 LIKE c0) = (NOT (c0 AND c1))
+----
+
+
+query I nosort
+SELECT count(*) FROM b2 WHERE (c0 = c0)
+----
+2
+
+-- next query fails with: 42000!Error in optimizer defaultpipe: 
TypeException:user.main[14]:'calc.or' undefined in:     X_100:any := 
calc.or(X_96:bit, X_98:oid);
+-- createExceptionInternal: ERROR: MALException:defaultpipe:42000!Error in 
optimizer defaultpipe: TypeException:user.main[14]:'calc.or' undefined in:     
X_100:any := calc.or(X_96:bit, X_98:oid);
+query I nosort
+SELECT count(*) FROM b2 WHERE (c0 = c0) = (NOT (c0 AND c1))
+----
+2
+
+query T nosort
+EXPLAIN SELECT count(*) FROM b2 WHERE (c0 = c0) = (NOT (c0 AND c1))
+----
+project (
+| group by (
+| | select (
+| | | table("sys"."b2") [ "b2"."c0", "b2"."c1" ]
+| | ) [ (("b2"."c0") = ("b2"."c0")) = ( !.AND("b2"."c0", "b2"."c1")) ]
+| ) [  ] [ "sys"."count"() as "%1"."%1" ]
+) [ "%1"."%1" ]
+
+statement ok
+DROP TABLE b2
+
diff --git a/sql/test/BugTracker-2026/Tests/8025-having-count-bug.test 
b/sql/test/BugTracker-2026/Tests/8025-having-count-bug.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2026/Tests/8025-having-count-bug.test
@@ -0,0 +1,67 @@
+statement ok
+CREATE TABLE t0(c1 INTEGER, c2 INTEGER)
+
+statement ok
+CREATE TABLE t1(c0 INTEGER, c2 INTEGER)
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to