Changeset: dfe992e4125d for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/dfe992e4125d Modified Files: debian/control gdk/gdk_utils.c testing/sqllogictest.py Branch: default Log Message:
Merge with Mar2025 branch. diffs (truncated from 2036 to 300 lines): diff --git a/ChangeLog.Mar2025 b/ChangeLog.Mar2025 --- a/ChangeLog.Mar2025 +++ b/ChangeLog.Mar2025 @@ -1,6 +1,10 @@ # ChangeLog file for devel # This file is updated with Maddlog +* Tue Mar 11 2025 Sjoerd Mullender <[email protected]> +- There is a new shared library called libmutils that contains some + utility functions that are used by several programs. + * Mon Sep 16 2024 Joeri van Ruth <[email protected]> - Hot snapshot: allow member files larger than 64 GiB. By member files we mean the files inside the resulting .tar file, not the tar file itself. Huge member diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -1356,9 +1356,9 @@ char *prompt_getlogin(void); struct dirent *readdir(DIR *dir); void rewinddir(DIR *dir); char *simple_prompt(const char *prompt, int maxlen, int echo, const char *def); -char *utf16toutf8(const utf16_t *src); +char *utf16toutf8(const uint16_t *src); const uint8_t utf8d[364]; -utf16_t *utf8toutf16(const char *src); +uint16_t *utf8toutf16(const char *src); int winerror(int); # sql diff --git a/clients/mapiclient/ReadlineTools.c b/clients/mapiclient/ReadlineTools.c --- a/clients/mapiclient/ReadlineTools.c +++ b/clients/mapiclient/ReadlineTools.c @@ -307,7 +307,7 @@ continue_completion(rl_completion_func_t static void readline_show_error(const char *msg) { rl_save_prompt(); - rl_message(msg); + rl_message("%s", msg); rl_restore_prompt(); rl_clear_message(); } diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -2752,7 +2752,7 @@ doFile(Mapi mid, stream *fp, bool useins for (line += 2; *line && my_isspace(*line); line++) ; if (*line == 0) { - /* turn of logging */ + /* turn off logging */ mapi_log(mid, NULL); } else { logfile = strdup(line); diff --git a/clients/mapilib/msettings.c b/clients/mapilib/msettings.c --- a/clients/mapilib/msettings.c +++ b/clients/mapilib/msettings.c @@ -29,12 +29,12 @@ #define FATAL() do { fprintf(stderr, "\n\n abort in msettings.c: %s\n\n", __func__); abort(); } while (0) -const char * const MALLOC_FAILED = "malloc failed"; +const char MALLOC_FAILED[] = "malloc failed"; bool msettings_malloc_failed(msettings_error err) { - return ((const char*)err == (const char*)MALLOC_FAILED); + return (err == MALLOC_FAILED); } diff --git a/clients/mapilib/msettings_internal.h b/clients/mapilib/msettings_internal.h --- a/clients/mapilib/msettings_internal.h +++ b/clients/mapilib/msettings_internal.h @@ -15,7 +15,7 @@ #include "msettings.h" -extern const char * const MALLOC_FAILED; +extern const char MALLOC_FAILED[]; struct string { diff --git a/debian/control b/debian/control --- a/debian/control +++ b/debian/control @@ -59,7 +59,7 @@ Description: MonetDB mutils library Package: libmonetdb-mutils-dev Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, - libmonetdb-mutils27 (= ${source:Version}) + libmonetdb-mutils1 (= ${source:Version}) Description: MonetDB mutils library development files MonetDB is a database management system that is developed from a main-memory perspective with use of a fully decomposed storage model, @@ -84,7 +84,7 @@ Description: MonetDB stream library Package: libmonetdb-stream-dev Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, - libmonetdb-stream27 (= ${source:Version}) + libmonetdb-stream27 (= ${source:Version}), libmonetdb-mutils1 (= ${source:Version}) Description: MonetDB stream library development files MonetDB is a database management system that is developed from a diff --git a/debian/libmonetdbe-dev.install b/debian/libmonetdbe-dev.install --- a/debian/libmonetdbe-dev.install +++ b/debian/libmonetdbe-dev.install @@ -1,4 +1,4 @@ debian/tmp/usr/lib/x86_64-linux-gnu/libmonetdbe.so usr/lib/x86_64-linux-gnu debian/tmp/usr/include/monetdb/monetdbe.h usr/include/monetdb debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig/monetdbe.pc usr/lib/x86_64-linux-gnu/pkgconfig -debian/tmp/usr/share/monetdb/cmake/monetdbeTargets.cmake usr/share/monetdb/cmake +debian/tmp/usr/share/monetdb/cmake/monetdbeTargets*.cmake usr/share/monetdb/cmake diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c --- a/gdk/gdk_batop.c +++ b/gdk/gdk_batop.c @@ -511,7 +511,6 @@ append_msk_bat(BAT *b, BATiter *ni, stru uint32_t boff = b->batCount % 32; uint32_t *bp = (uint32_t *) b->theap->base + b->batCount / 32; b->batCount += ci->ncand; - b->theap->free = ((b->batCount + 31) / 32) * 4; if (ci->tpe == cand_dense) { const uint32_t *np; uint32_t noff, mask; @@ -664,6 +663,7 @@ append_msk_bat(BAT *b, BATiter *ni, stru } while (!is_oid_nil(o)); } b->theap->dirty = true; + b->theap->free = ((b->batCount + 31) / 32) * 4; MT_lock_unset(&b->theaplock); return GDK_SUCCEED; } diff --git a/gdk/gdk_orderidx.c b/gdk/gdk_orderidx.c --- a/gdk/gdk_orderidx.c +++ b/gdk/gdk_orderidx.c @@ -54,6 +54,7 @@ BATidxsync(void *arg) if (!(ATOMIC_GET(&GDKdebug) & NOSYNCMASK) && MT_msync(hp->base, SIZEOF_OID) < 0) { hp->dirty = true; + failed = " sync failed"; ((oid *) hp->base)[0] &= ~((oid) 1 << 24); } else { failed = ""; /* not failed */ diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c --- a/gdk/gdk_utils.c +++ b/gdk/gdk_utils.c @@ -2234,7 +2234,10 @@ sa_alloc(allocator *sa, size_t sz) } sa->blks = tmp; } - if (sz > SA_BLOCK) { + if (sz >= SA_BLOCK) { + // The request is large so it gets its own block. + // We put it 'under' the current block because + // there may still be plenty of usable space there. sa->blks[sa->nr] = sa->blks[sa->nr-1]; sa->blks[sa->nr-1] = r; sa->nr ++; diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c --- a/sql/storage/bat/bat_storage.c +++ b/sql/storage/bat/bat_storage.c @@ -328,7 +328,6 @@ segments2cs(sql_trans *tr, segments *seg b->tkey = false; b->tnokey[0] = 0; b->tnokey[1] = 0; - b->theap->dirty = true; BUN cnt = BATcount(b); uint32_t *restrict dst; diff --git a/sql/test/BugTracker-2025/Tests/7621_count_case_crash.test b/sql/test/BugTracker-2025/Tests/7621_count_case_crash.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2025/Tests/7621_count_case_crash.test @@ -0,0 +1,15 @@ +statement ok +create table count_case_crash(id int, key int) + +query IT +SELECT count(*), + CASE WHEN now() < (now() + interval '1' day) THEN + 'yes' + ELSE + 'no' + END AS name +FROM + count_case_crash +---- +0 +yes 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 @@ -2,3 +2,4 @@ 7611_multiple_unnd_constraints 7614_join_reordering 7615_join_reordering_2 7616_join_reordering_3 +7621_count_case_crash diff --git a/sql/test/miscellaneous/Tests/groupby_prepare.SQL.py b/sql/test/miscellaneous/Tests/groupby_prepare.SQL.py deleted file mode 100644 --- a/sql/test/miscellaneous/Tests/groupby_prepare.SQL.py +++ /dev/null @@ -1,9 +0,0 @@ -from MonetDBtesting.sqltest import SQLTestCase - -with SQLTestCase() as tc: - # optional or default connection - tc.connect() - with open('groupby_prepare.sql') as f: - tc.execute(query=None, client='mclient', stdin=f)\ - .assertMatchStableOut(fout='groupby_prepare.stable.out')\ - .assertMatchStableError(ferr='groupby_prepare.stable.err') diff --git a/sql/test/miscellaneous/Tests/groupby_prepare.sql b/sql/test/miscellaneous/Tests/groupby_prepare.sql deleted file mode 100644 --- a/sql/test/miscellaneous/Tests/groupby_prepare.sql +++ /dev/null @@ -1,40 +0,0 @@ -CREATE TABLE tab0(col0 INTEGER, col1 INTEGER, col2 INTEGER); -INSERT INTO tab0 VALUES(97,1,99), (15,81,47), (87,21,10); - -prepare select col0 from tab0 where (?) in (select col0 from tab0); -prepare select col0 from tab0 where (?,?) in (select col0,col1 from tab0); -prepare select col0 from tab0 where (col1,col1) in (select col0,? from tab0); -prepare select col0 from tab0 where (col1,col1) in (select ?,? from tab0); -prepare select col0 from tab0 where (col0) in (?); -prepare select col0 from tab0 where (col0) in (?,?); - -prepare select ? < ANY (select max(col0) from tab0) from tab0 t1; -prepare select col0 = ALL (select ? from tab0) from tab0 t1; - -prepare select 1 from tab0 where 1 between ? and ?; -prepare select 1 from tab0 where ? between 1 and ?; -prepare select 1 from tab0 where ? between ? and 1; - -prepare select EXISTS (SELECT ? FROM tab0) from tab0; -prepare select EXISTS (SELECT ?,? FROM tab0) from tab0; - -prepare select col0 from tab0 where (?) in (?); --error -prepare select ? = ALL (select ? from tab0) from tab0 t1; --error -prepare select 1 from tab0 where ? between ? and ?; --error - -prepare select case when col0 = 0 then ? else 1 end from tab0; -prepare select case when col0 = 0 then 1 else ? end from tab0; -prepare select case when col0 = 0 then ? else ? end from tab0; --error - -prepare select case when col0 = 0 then ? when col0 = 1 then ? else 1 end from tab0; -prepare select case when col0 = 0 then ? when col0 = 1 then ? else ? end from tab0; --error - -prepare select ? is null from tab0; --error -prepare select max(?); --error -prepare select max(?) over (); --error - -CREATE TABLE tab1(col0 INTEGER, col1 STRING); -prepare select 1 from tab1 where (col0,col1) in (select ?,? from tab1); - -drop table tab0; -drop table tab1; diff --git a/sql/test/miscellaneous/Tests/groupby_prepare.stable.err b/sql/test/miscellaneous/Tests/groupby_prepare.stable.err deleted file mode 100644 --- a/sql/test/miscellaneous/Tests/groupby_prepare.stable.err +++ /dev/null @@ -1,28 +0,0 @@ -MAPI = monetdb@localhost:50000 -QUERY = prepare select col0 from tab0 where (?) in (?); --error -ERROR = !For the IN operator, both sides must have a type defined -CODE = 42000 -MAPI = monetdb@localhost:50000 -QUERY = prepare select ? = ALL (select ? from tab0) from tab0 t1; --error -ERROR = !Cannot have a parameter (?) on both sides of an expression -CODE = 42000 -MAPI = monetdb@localhost:50000 -QUERY = prepare select 1 from tab0 where ? between ? and ?; --error -ERROR = !Cannot have a parameter (?) on both sides of an expression -CODE = 42000 -MAPI = monetdb@localhost:50000 -QUERY = prepare select case when col0 = 0 then ? else ? end from tab0; --error -ERROR = !Result type missing -CODE = 42000 -MAPI = monetdb@localhost:50000 -QUERY = prepare select case when col0 = 0 then ? when col0 = 1 then ? else ? end from tab0; --error -ERROR = !Result type missing -CODE = 42000 -MAPI = monetdb@localhost:50000 -QUERY = prepare select max(?); --error -ERROR = !MAX: parameters not allowed as arguments to aggregate functions -CODE = 42000 -MAPI = monetdb@localhost:50000 -QUERY = prepare select max(?) over (); --error -ERROR = !MAX: parameters not allowed as arguments to window functions -CODE = 42000 diff --git a/sql/test/miscellaneous/Tests/groupby_prepare.stable.out b/sql/test/miscellaneous/Tests/groupby_prepare.stable.out deleted file mode 100644 --- a/sql/test/miscellaneous/Tests/groupby_prepare.stable.out +++ /dev/null @@ -1,159 +0,0 @@ -#CREATE TABLE tab0(col0 INTEGER, col1 INTEGER, col2 INTEGER); -#INSERT INTO tab0 VALUES(97,1,99), (15,81,47), (87,21,10); -[ 3 ] -#prepare select col0 from tab0 where (?) in (select col0 from tab0); -#prepare select col0 from tab0 where (?) in (select col0 from tab0); -% .prepare, .prepare, .prepare, .prepare, .prepare, .prepare # table_name _______________________________________________ checkin-list mailing list -- [email protected] To unsubscribe send an email to [email protected]
