Changeset: 219b3cd2e4ee for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/219b3cd2e4ee
Modified Files:
        sql/backends/monet5/sql_rank.c
        sql/test/BugTracker-2025/Tests/All
Branch: default
Log Message:

Merge with Mar2025 branch.


diffs (155 lines):

diff --git a/sql/backends/monet5/sql_rank.c b/sql/backends/monet5/sql_rank.c
--- a/sql/backends/monet5/sql_rank.c
+++ b/sql/backends/monet5/sql_rank.c
@@ -1143,17 +1143,21 @@ do_lead_lag(Client cntxt, MalBlkPtr mb, 
                                goto bailout;
                        }
                        bpi = bat_iterator(d);
-                       p = BUNtail(bpi, 0);
-                       default_size = ATOMlen(tp3, p);
-                       default_value = GDKmalloc(default_size);
-                       if (default_value)
-                               memcpy(default_value, p, default_size);
+                       if (bpi.count > 0) {
+                               p = BUNtail(bpi, 0);
+                               default_size = ATOMlen(tp3, p);
+                               default_value = GDKmalloc(default_size);
+                               if (default_value)
+                                       memcpy(default_value, p, default_size);
+                               free_default_value = true;
+                       } else {
+                               default_value = (void *)ATOMnilptr(bpi.type);
+                       }
                        bat_iterator_end(&bpi);
                        if (!default_value) {
                                msg = createException(SQL, op, SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
                                goto bailout;
                        }
-                       free_default_value = true;
                } else {
                        ValRecord *in = &(stk)->stk[(pci)->argv[3]];
                        default_value = VALget(in);
diff --git a/sql/benchmarks/tpcds/Tests/prio b/sql/benchmarks/tpcds/Tests/prio
new file mode 100644
--- /dev/null
+++ b/sql/benchmarks/tpcds/Tests/prio
@@ -0,0 +1,1 @@
+1
diff --git a/sql/test/BugTracker-2025/Tests/7648_rightjoin_crash.test 
b/sql/test/BugTracker-2025/Tests/7648_rightjoin_crash.test
--- a/sql/test/BugTracker-2025/Tests/7648_rightjoin_crash.test
+++ b/sql/test/BugTracker-2025/Tests/7648_rightjoin_crash.test
@@ -1,7 +1,7 @@
 statement ok
 CREATE TABLE IF NOT EXISTS t0(c0 INT)
 
-query II
+query II nosort
 SELECT * FROM t0 RIGHT JOIN (VALUES (1)) AS subQuery1(col_1) ON EXISTS (VALUES 
(CASE subQuery1.col_1 WHEN subQuery1.col_1 THEN 1 END))
 ----
 NULL
@@ -13,6 +13,7 @@ CREATE TABLE IF NOT EXISTS t1(c0 DOUBLE 
 statement ok
 CREATE TABLE IF NOT EXISTS t2(c0 DOUBLE )
 
-query II
-SELECT * FROM t1 INNER JOIN t2 ON (NOT EXISTS (VALUES (((t1.c0)+(t2.c0))))) IS 
NULL;
+query RR nosort
+SELECT * FROM t1 INNER JOIN t2 ON (NOT EXISTS (VALUES (((t1.c0)+(t2.c0))))) IS 
NULL
 ----
+
diff --git a/sql/test/BugTracker-2025/Tests/7650_right_join_crash.test 
b/sql/test/BugTracker-2025/Tests/7650_right_join_crash.test
--- a/sql/test/BugTracker-2025/Tests/7650_right_join_crash.test
+++ b/sql/test/BugTracker-2025/Tests/7650_right_join_crash.test
@@ -1,6 +1,7 @@
 statement ok
 CREATE TABLE IF NOT EXISTS t1(c0 INTERVAL DAY,c2 DOUBLE)
 
-query ITI 
+query TRI nosort
 SELECT ALL * FROM t1 RIGHT JOIN (VALUES (0)) AS subQuery1(col_1) ON ( t1.c0 < 
ANY(VALUES (t1.c0+t1.c0)) ) AND (VALUES (subQuery1.col_1), (EXISTS (VALUES 
(t1.c2))) )
 ----
+
diff --git a/sql/test/BugTracker-2025/Tests/7656_incorrect_error.test 
b/sql/test/BugTracker-2025/Tests/7656_incorrect_error.test
--- a/sql/test/BugTracker-2025/Tests/7656_incorrect_error.test
+++ b/sql/test/BugTracker-2025/Tests/7656_incorrect_error.test
@@ -1,4 +1,3 @@
-
 -- the primary key
 statement ok
 create table a(id int)
@@ -21,3 +20,4 @@ alter table b add foreign key(i) referen
 
 statement error 40000!DROP TABLE: FOREIGN KEY b.b_i_fkey depends on a
 drop table a
+
diff --git a/sql/test/BugTracker-2025/Tests/7659_trigger_crashes.test 
b/sql/test/BugTracker-2025/Tests/7659_trigger_crashes.test
--- a/sql/test/BugTracker-2025/Tests/7659_trigger_crashes.test
+++ b/sql/test/BugTracker-2025/Tests/7659_trigger_crashes.test
@@ -20,9 +20,8 @@ statement ok
 CREATE TABLE table1(column1 INT, column2 INT)
 
 statement error
-CREATE TRIGGER trigger6 AFTER UPDATE ON table1 REFERENCING OLD TABLE AS 
old_table NEW TABLE AS new_table FOR EACH STATEMENT SELECT * FROM sys.triggers;
+CREATE TRIGGER trigger6 AFTER UPDATE ON table1 REFERENCING OLD TABLE AS 
old_table NEW TABLE AS new_table FOR EACH STATEMENT SELECT * FROM sys.triggers
 
 statement ok
 drop table table1
 
-
diff --git a/sql/test/BugTracker-2025/Tests/7671-lag-over-empty-bat.test 
b/sql/test/BugTracker-2025/Tests/7671-lag-over-empty-bat.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2025/Tests/7671-lag-over-empty-bat.test
@@ -0,0 +1,7 @@
+statement ok
+CREATE TABLE table1 (column1 INT, column2 BLOB)
+
+query T nosort
+SELECT LAG(column2, 1, column2) OVER () FROM table1
+----
+
diff --git a/sql/test/BugTracker-2025/Tests/All 
b/sql/test/BugTracker-2025/Tests/All
--- a/sql/test/BugTracker-2025/Tests/All
+++ b/sql/test/BugTracker-2025/Tests/All
@@ -22,3 +22,4 @@ 7653_incorrect_join_results
 7654_non_monetdb_user_remote_table_exec
 7656_incorrect_error
 7659_trigger_crashes
+7671-lag-over-empty-bat
diff --git a/sql/test/SQLite_regress/sqllogictest/Tests/prio 
b/sql/test/SQLite_regress/sqllogictest/Tests/prio
new file mode 100644
--- /dev/null
+++ b/sql/test/SQLite_regress/sqllogictest/Tests/prio
@@ -0,0 +1,1 @@
+2
diff --git a/sql/test/Tests/prio b/sql/test/Tests/prio
new file mode 100644
--- /dev/null
+++ b/sql/test/Tests/prio
@@ -0,0 +1,1 @@
+4
diff --git a/sql/test/bincopy/Tests/prio b/sql/test/bincopy/Tests/prio
new file mode 100644
--- /dev/null
+++ b/sql/test/bincopy/Tests/prio
@@ -0,0 +1,1 @@
+3
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -4116,6 +4116,15 @@ def main(argv) :
                 if not errseen and diff > F_WARN:
                     errseen = True
             else:
+                td = []
+                for d in testdirs:
+                    try:
+                        with openutf8(os.path.join(d, TSTSUFF, 'prio')) as f:
+                            prio = int(f.read())
+                    except:
+                        prio = 1000
+                    td.append((prio, d))
+                testdirs = [d for (prio, d) in sorted(td)]
                 if verbosity > 1:
                     print('\nRunning all tests in directories %s.\n' % 
str(testdirs))
                 with 
concurrent.futures.ThreadPoolExecutor(max_workers=opts.parallel) as tp:
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to