MonetDB: groupjoin - merged with default
Changeset: f6aa163ef5de for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/f6aa163ef5de Branch: groupjoin Log Message: merged with default diffs (truncated from 833 to 300 lines): diff --git a/ChangeLog.Jun2023 b/ChangeLog.Jun2023 --- a/ChangeLog.Jun2023 +++ b/ChangeLog.Jun2023 @@ -1,3 +1,7 @@ # ChangeLog file for devel # This file is updated with Maddlog +* Fri Sep 29 2023 Sjoerd Mullender +- Fixed an installation issue on Debian and Ubuntu introduced in the + last build. + 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 @@ -214,7 +214,7 @@ BBPrec *BBP[N_BBPINIT]; gdk_return BBPaddfarm(const char *dirname, uint32_t rolemask, bool logerror); void BBPcold(bat i); int BBPfix(bat b); -unsigned BBPheader(FILE *fp, int *lineno, bat *bbpsize, lng *logno, lng *transid); +unsigned BBPheader(FILE *fp, int *lineno, bat *bbpsize, lng *logno, lng *transid, bool allow_hge_upgrade); bat BBPindex(const char *nme); void BBPkeepref(BAT *b) __attribute__((__nonnull__(1))); bat BBPlimit; diff --git a/clients/odbc/tests/ODBCtester.c b/clients/odbc/tests/ODBCtester.c --- a/clients/odbc/tests/ODBCtester.c +++ b/clients/odbc/tests/ODBCtester.c @@ -88,11 +88,7 @@ retrieveDiagMsg(SQLHANDLE stmt, char * o /* The message layout is: "[MonetDB][ODBC Driver 11.46.0][MonetDB-Test]error/warning text". The ODBC driver version numbers changes in time. Overwrite it to get a stable output */ if (strncmp(msg, "[MonetDB][ODBC Driver 11.", 25) == 0) { - for (int i = 25; msg[i] != ']'; i++) { - if (isdigit(msg[i])) { - msg[i] = '#'; - } - } + return snprintf(outp, outp_len, "SQLstate %s, Errnr %d, Message [MonetDB][ODBC Driver 11.##.#]%s\n", (char*)state, (int)errnr, strchr(msg + 25, ']') + 1); } return snprintf(outp, outp_len, "SQLstate %s, Errnr %d, Message %s\n", (char*)state, (int)errnr, (char*)msg); } diff --git a/debian/rules b/debian/rules --- a/debian/rules +++ b/debian/rules @@ -57,3 +57,6 @@ override_dh_auto_install: rm debian/tmp/usr/lib/*/monetdb5/lib_opt_sql_append.so rm debian/tmp/usr/lib/*/monetdb5/lib_microbenchmark*.so rm debian/tmp/usr/lib/*/monetdb5/lib_udf*.so + +override_dh_installsystemd: + dh_installsystemd --no-enable --no-start diff --git a/gdk/ChangeLog b/gdk/ChangeLog --- a/gdk/ChangeLog +++ b/gdk/ChangeLog @@ -1,3 +1,9 @@ # ChangeLog file for GDK # This file is updated with Maddlog +* Thu Sep 28 2023 Sjoerd Mullender +- We now prevent accidental upgrades from a database without 128 bit + integers to one with 128 bit integers (also known as HUGEINT) from + happening. Upgrades will only be done if the server is started with + the option --set allow_hge_upgrade=yes. + diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -985,7 +985,7 @@ BBPcheckbats(unsigned bbpversion) #endif unsigned -BBPheader(FILE *fp, int *lineno, bat *bbpsize, lng *logno, lng *transid) +BBPheader(FILE *fp, int *lineno, bat *bbpsize, lng *logno, lng *transid, bool allow_hge_upgrade) { char buf[BUFSIZ]; int sz, ptrsize, oidsize, intsize; @@ -1034,6 +1034,13 @@ BBPheader(FILE *fp, int *lineno, bat *bb SIZEOF_MAX_INT, intsize); return 0; } + if (intsize < SIZEOF_MAX_INT && !allow_hge_upgrade) { + TRC_CRITICAL(GDK, "database created with incompatible server: " +"expected max. integer size %d, got %d; " +"use --set allow_hge_upgrade=yes to upgrade.", +SIZEOF_MAX_INT, intsize); + return 0; + } if (fgets(buf, sizeof(buf), fp) == NULL) { TRC_CRITICAL(GDK, "short BBP"); return 0; @@ -1548,7 +1555,7 @@ BBPmanager(void *dummy) static MT_Id manager; gdk_return -BBPinit(void) +BBPinit(bool allow_hge_upgrade) { FILE *fp = NULL; struct stat st; @@ -1678,7 +1685,7 @@ BBPinit(void) bbpversion = GDKLIBRARY; } else { lng logno, transid; - bbpversion = BBPheader(fp, , , , ); + bbpversion = BBPheader(fp, , , , , allow_hge_upgrade); if (bbpversion == 0) { ATOMIC_SET(, dbg); return GDK_FAIL; @@ -3692,7 +3699,7 @@ BBPcheckBBPdir(void) if (fp == NULL) return; } - bbpversion = BBPheader(fp, , , , ); + bbpversion = BBPheader(fp, , , , , false); if (bbpversion == 0) { fclose(fp); return; /* error reading file */ diff --git
MonetDB: groupjoin - merged with default
Changeset: d1db10c3dec6 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/d1db10c3dec6 Modified Files: sql/include/sql_relation.h sql/server/rel_optimizer_private.h Branch: groupjoin Log Message: merged with default diffs (187 lines): diff --git a/sql/include/sql_relation.h b/sql/include/sql_relation.h --- a/sql/include/sql_relation.h +++ b/sql/include/sql_relation.h @@ -143,8 +143,7 @@ typedef enum ddl_statement { ddl_comment_on, ddl_rename_schema, ddl_rename_table, - ddl_rename_column, - ddl_maxops /* evaluated to the max value, should be always kept at the bottom */ + ddl_rename_column } ddl_statement; typedef enum operator_type { @@ -169,7 +168,7 @@ typedef enum operator_type { op_update, /* update(l=table, r update expressions) */ op_delete, /* delete(l=table, r delete expression) */ op_truncate, /* truncate(l=table) */ - op_merge + op_merge /* IMPORTANT: keep op_merge last */ } operator_type; #define is_atom(et)(et == e_atom) diff --git a/sql/server/rel_optimizer_private.h b/sql/server/rel_optimizer_private.h --- a/sql/server/rel_optimizer_private.h +++ b/sql/server/rel_optimizer_private.h @@ -15,7 +15,7 @@ /* relations counts */ typedef struct global_props { - int cnt[ddl_maxops]; + int cnt[op_merge + 1]; uint8_t instantiate:1, needs_mergetable_rewrite:1, diff --git a/sql/test/prepare/Tests/named_placeholders.test b/sql/test/prepare/Tests/named_placeholders.test --- a/sql/test/prepare/Tests/named_placeholders.test +++ b/sql/test/prepare/Tests/named_placeholders.test @@ -3,3 +3,24 @@ SELECT :banana; statement error 42000!Named placeholder ('pear') not used in the query. SELECT :banana : ( pear 'mango' ); + +query T +SELECT :banana : ( banana 'foo'); + +foo + +statement ok +create table tst_table (x int, y int); + +statement ok +insert into tst_table (x, y) values (:x, :y) : (x 1, y 1); +insert into tst_table (x, y) values (:x, :y) : (x 2, y 4); + +query II rowsort +SELECT x, y from tst_table; + +1 +1 +2 +4 + diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in --- a/testing/Mtest.py.in +++ b/testing/Mtest.py.in @@ -2069,7 +2069,7 @@ def RunTest(env, TST, COND, oktests, len rversion = os.path.join('@LIBR_INCLUDE_DIRS@', 'Rversion.h') if os.path.exists(rversion): with openutf8(rversion, 'r') as f: -res = re.search('#define R_VERSION (?P\d+)', f.read()) +res = re.search(r'#define R_VERSION (?P\d+)', f.read()) if res is not None: r_version = res.group('rversion') req_version = cond[11:].split('.') @@ -2130,7 +2130,7 @@ def RunTest(env, TST, COND, oktests, len reason = "as multiple SQL clients in parallel are currently not supported by %s." % THISFILE elem = SkipTest(env, TST, EXT, reason, length) else: -test = re.compile("^"+TST+"((_[sp][0-9][0-9])?\..*)?$", re.MULTILINE) +test = re.compile("^"+TST+r"((_[sp][0-9][0-9])?\..*)?$", re.MULTILINE) for f in listdir(RELSRCDIR): if test.match(f): try: @@ -2159,7 +2159,7 @@ def RunTest(env, TST, COND, oktests, len reason = "as source file '%s` is missing." % TSTSRC elem = SkipTest(env, TST, EXT+".src", reason, length) return TX,Failed,Failed,elem,reason,links -test = re.compile("^"+TST+"((_[sp][0-9][0-9])?\..*)?\.src$", re.MULTILINE) +test = re.compile("^"+TST+r"((_[sp][0-9][0-9])?\..*)?\.src$", re.MULTILINE) for ff in listdir(TSTTRGDIR): if test.match(ff) and not os.path.isfile(ff[:-4]): f = openutf8(ff,"r") @@ -2174,7 +2174,7 @@ def RunTest(env, TST, COND, oktests, len % (TSTSRC, ff[:-4], os.getcwd(), err.errno, err.strerror)) else: Warn("source file '"+TSTSRC+"` is missing.") -test = re.compile("^"+TST+"(_[sp][0-9][0-9])?\..*\.in$", re.MULTILINE) +test = re.compile("^"+TST+r"(_[sp][0-9][0-9])?\..*\.in$", re.MULTILINE) for ff in listdir(TSTTRGDIR): fff = ff[:-3] if test.match(ff) and not os.path.isfile(fff): @@ -2535,7 +2535,7 @@ def killProc(proc, outfile = None, cmd = sym = r'c:\Symbols;' elif os.path.exists(r'c:\Program Files\Debugging Tools for Windows (x86)\cdb.exe'): cdb = r'c:\Program Files\Debugging Tools for Windows (x86)\cdb.exe' -if os.path.exists('c:\WINDOWS\Symbols'): +if os.path.exists(r'c:\WINDOWS\Symbols'): sym = r'c:\WINDOWS\Symbols;' else: cdb = None @@ -3076,11 +3076,11 @@ def DoIt(env, SERVER, CALL, TST, EXT, Te # Try to
MonetDB: groupjoin - merged with default
Changeset: cd9d7171aa64 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/cd9d7171aa64 Branch: groupjoin Log Message: merged with default diffs (118 lines): diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -2247,7 +2247,7 @@ BBPdump(void) continue; BAT *b = BBP_desc(i); unsigned status = BBP_status(i); - printf("# %d: " ALGOOPTBATFMT "refs=%d lrefs=%d status=%u%s", + printf("# %d: " ALGOOPTBATFMT " refs=%d lrefs=%d status=%u%s", i, ALGOOPTBATPAR(b), BBP_refs(i), diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c --- a/gdk/gdk_storage.c +++ b/gdk/gdk_storage.c @@ -764,13 +764,12 @@ BATsave_iter(BAT *b, BATiter *bi, BUN si } if (size != b->batCount || b->batInserted < b->batCount) { /* if the sizes don't match, the BAT must be dirty */ - b->batCopiedtodisk = false; b->theap->dirty = true; if (b->tvheap) b->tvheap->dirty = true; - } else { - b->batCopiedtodisk = true; } + /* there is something on disk now */ + b->batCopiedtodisk = true; MT_lock_unset(>theaplock); if (locked && b->thash && b->thash != (Hash *) 1) BAThashsave(b, dosync); diff --git a/monetdb5/modules/kernel/bat5.c b/monetdb5/modules/kernel/bat5.c --- a/monetdb5/modules/kernel/bat5.c +++ b/monetdb5/modules/kernel/bat5.c @@ -675,17 +675,16 @@ HASHinfo(BAT *bk, BAT *bv, Hash *h, str return GDK_SUCCEED; } - static str -BATinfo(BAT **key, BAT **val, const bat bid) +BKCinfo(bat *ret1, bat *ret2, const bat *bid) { const char *mode, *accessmode; BAT *bk = NULL, *bv = NULL, *b; char bf[oidStrlen]; char buf[32]; - if ((b = BATdescriptor(bid)) == NULL) { - throw(MAL, "BATinfo", SQLSTATE(HY002) RUNTIME_OBJECT_MISSING); + if ((b = BATdescriptor(*bid)) == NULL) { + throw(MAL, "bat.info", SQLSTATE(HY002) RUNTIME_OBJECT_MISSING); } bk = COLnew(0, TYPE_str, 128, TRANSIENT); @@ -694,7 +693,7 @@ BATinfo(BAT **key, BAT **val, const bat BBPreclaim(bk); BBPreclaim(bv); BBPunfix(b->batCacheid); - throw(MAL, "bat.getInfo", SQLSTATE(HY013) MAL_MALLOC_FAIL); + throw(MAL, "bat.info", SQLSTATE(HY013) MAL_MALLOC_FAIL); } BATiter bi = bat_iterator(b); @@ -718,11 +717,11 @@ BATinfo(BAT **key, BAT **val, const bat accessmode = "unknown"; } - if (BUNappend(bk, "batId", false) != GDK_SUCCEED || - BUNappend(bv, BATgetId(b), false) != GDK_SUCCEED || - BUNappend(bk, "batCacheid", false) != GDK_SUCCEED || - BUNappend(bv, local_itoa((ssize_t) b->batCacheid, buf), - false) != GDK_SUCCEED + if (BUNappend(bk, "batId", false) != GDK_SUCCEED + || BUNappend(bv, BATgetId(b), false) != GDK_SUCCEED + || BUNappend(bk, "batCacheid", false) != GDK_SUCCEED + || BUNappend(bv, local_itoa((ssize_t) b->batCacheid, buf), +false) != GDK_SUCCEED || BUNappend(bk, "tparentid", false) != GDK_SUCCEED || BUNappend(bv, local_itoa((ssize_t) bi.h->parentid, buf), false) != GDK_SUCCEED @@ -803,7 +802,7 @@ BATinfo(BAT **key, BAT **val, const bat BBPreclaim(bk); BBPreclaim(bv); BBPunfix(b->batCacheid); - throw(MAL, "bat.getInfo", SQLSTATE(HY013) MAL_MALLOC_FAIL); + throw(MAL, "bat.info", SQLSTATE(HY013) MAL_MALLOC_FAIL); } /* dump index information */ MT_rwlock_rdlock(>thashlock); @@ -813,25 +812,12 @@ BATinfo(BAT **key, BAT **val, const bat BBPreclaim(bk); BBPreclaim(bv); BBPunfix(b->batCacheid); - throw(MAL, "bat.getInfo", SQLSTATE(HY013) MAL_MALLOC_FAIL); + throw(MAL, "bat.info", SQLSTATE(HY013) MAL_MALLOC_FAIL); } MT_rwlock_rdunlock(>thashlock); bat_iterator_end(); - *key = bk; - *val = bv; assert(BATcount(bk) == BATcount(bv)); - BBPunfix(bid); - return MAL_SUCCEED; -} - -static str -BKCinfo(bat *ret1, bat *ret2, const bat *bid) -{ - BAT *bv, *bk; - str msg; - - if ((msg = BATinfo(, , *bid)) != NULL) - return msg; + BBPunfix(b->batCacheid); *ret1 = bk->batCacheid; BBPkeepref(bk); *ret2 = bv->batCacheid; ___ checkin-list mailing
MonetDB: groupjoin - merged with default
Changeset: 48caad55ce38 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/48caad55ce38 Branch: groupjoin Log Message: merged with default diffs (286 lines): diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c --- a/gdk/gdk_logger.c +++ b/gdk/gdk_logger.c @@ -2085,6 +2085,12 @@ log_load(const char *fn, const char *log lg->seqs_val = BATdescriptor(BBPindex(bak)); strconcat_len(bak, sizeof(bak), fn, "_dseqs", NULL); lg->dseqs = BATdescriptor(BBPindex(bak)); + if (lg->seqs_id == NULL || + lg->seqs_val == NULL || + lg->dseqs == NULL) { + GDKerror("Logger_new: cannot load seqs bats"); + goto error; + } } else { lg->seqs_id = logbat_new(TYPE_int, 1, PERSISTENT); lg->seqs_val = logbat_new(TYPE_lng, 1, PERSISTENT); diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c --- a/gdk/gdk_storage.c +++ b/gdk/gdk_storage.c @@ -550,7 +550,7 @@ GDKload(int farmid, const char *nme, con for (n_expected = (ssize_t) size; n_expected > 0; n_expected -= n) { n = read(fd, dst, (unsigned) MIN(1 << 30, n_expected)); if (n < 0) - GDKsyserror("GDKload: cannot read: name=%s, ext=%s, %zu bytes missing\n", nme, ext ? ext : "", (size_t) n_expected); + GDKsyserror("GDKload: cannot read: name=%s, ext=%s, expected %zu, %zd bytes missing\n", nme, ext ? ext : "", size, n_expected); #ifndef __COVERITY__ /* Coverity doesn't seem to * recognize that we're just @@ -567,7 +567,8 @@ GDKload(int farmid, const char *nme, con /* we couldn't read all, error * already generated */ GDKfree(ret); - GDKerror("short read from heap %s%s%s, expected %zu, missing %zd\n", nme, ext ? "." : "", ext ? ext : "", size, n_expected); + if (n >= 0) /* don't report error twice */ + GDKerror("short read from heap %s%s%s, expected %zu, missing %zd\n", nme, ext ? "." : "", ext ? ext : "", size, n_expected); ret = NULL; } #ifndef NDEBUG diff --git a/monetdb5/modules/kernel/batmmath.c b/monetdb5/modules/kernel/batmmath.c --- a/monetdb5/modules/kernel/batmmath.c +++ b/monetdb5/modules/kernel/batmmath.c @@ -95,9 +95,10 @@ CMDscienceUNARY(MalStkPtr stk, InstrPtr BBPreclaim(s); if (e != 0 || ex != 0) { const char *err; + char buf[128]; BBPunfix(bn->batCacheid); if (e) - err = GDKstrerror(e, (char[128]) { 0 }, 128); + err = GDKstrerror(e, buf, 128); else if (ex & FE_DIVBYZERO) err = "Divide by zero"; else if (ex & FE_OVERFLOW) @@ -323,9 +324,10 @@ CMDscienceBINARY(MalStkPtr stk, InstrPtr throw(MAL, malfunc, GDK_EXCEPTION); if (e != 0 || ex != 0) { const char *err; + char buf[128]; BBPunfix(bn->batCacheid); if (e) - err = GDKstrerror(e, (char[128]) { 0 }, 128); + err = GDKstrerror(e, buf, 128); else if (ex & FE_DIVBYZERO) err = "Divide by zero"; else if (ex & FE_OVERFLOW) diff --git a/monetdb5/modules/kernel/mmath.c b/monetdb5/modules/kernel/mmath.c --- a/monetdb5/modules/kernel/mmath.c +++ b/monetdb5/modules/kernel/mmath.c @@ -96,8 +96,9 @@ MATHunary##NAME##TYPE(TYPE *res, const T (ex = fetestexcept(FE_INVALID | FE_DIVBYZERO | \ FE_OVERFLOW)) != 0) {\ const char *err; \ + char buf[128]; \ if (e) { \ - err = GDKstrerror(e, (char[128]){0}, 128); \ + err = GDKstrerror(e, buf, 128); \ } else if (ex & FE_DIVBYZERO) \ err = "Divide by zero";
MonetDB: groupjoin - merged with default
Changeset: 772e36340c82 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/772e36340c82 Modified Files: clients/Tests/MAL-signatures-hge.test clients/Tests/MAL-signatures.test Branch: groupjoin Log Message: merged with default diffs (truncated from 1563 to 300 lines): diff --git a/clients/Tests/MAL-signatures-hge.test b/clients/Tests/MAL-signatures-hge.test --- a/clients/Tests/MAL-signatures-hge.test +++ b/clients/Tests/MAL-signatures-hge.test @@ -51063,56 +51063,6 @@ user_statistics pattern sysmon.user_statistics() (X_0:bat[:str], X_1:bat[:lng], X_2:bat[:lng], X_3:bat[:timestamp], X_4:bat[:timestamp], X_5:bat[:lng], X_6:bat[:str]) SYSMONstatistics; (empty) -tokenizer -append -command tokenizer.append(X_0:str):oid -TKNZRappend; -tokenize a new string and append it to the tokenizer (duplicate elimination is performed) -tokenizer -close -command tokenizer.close():void -TKNZRclose; -close the current tokenizer store -tokenizer -depositFile -command tokenizer.depositFile(X_0:str):void -TKNZRdepositFile; -batch insertion from a file of strings to tokenize, each string is separated by a new line -tokenizer -getCardinality -command tokenizer.getCardinality():bat[:lng] -TKNZRgetCardinality; -debugging function that returns the unique tokens at each level -tokenizer -getCount -command tokenizer.getCount():bat[:lng] -TKNZRgetCount; -debugging function that returns the size of the bats at each level -tokenizer -getIndex -command tokenizer.getIndex():bat[:oid] -TKNZRgetIndex; -administrative function that returns the INDEX bat -tokenizer -getLevel -command tokenizer.getLevel(X_0:int):bat[:str] -TKNZRgetLevel; -administrative function that returns the bat on level i -tokenizer -locate -pattern tokenizer.locate(X_0:str):oid -TKNZRlocate; -if the given string is in the store returns its oid, otherwise oid_nil -tokenizer -open -command tokenizer.open(X_0:str):void -TKNZRopen; -open the named tokenizer store, a new one is created if the specified name does not exist -tokenizer -take -pattern tokenizer.take(X_0:oid):str -TKNZRtakeOid; -reconstruct and returns the i-th string txtsim dameraulevenshtein pattern txtsim.dameraulevenshtein(X_0:str, X_1:str):int diff --git a/clients/Tests/MAL-signatures.test b/clients/Tests/MAL-signatures.test --- a/clients/Tests/MAL-signatures.test +++ b/clients/Tests/MAL-signatures.test @@ -39378,56 +39378,6 @@ user_statistics pattern sysmon.user_statistics() (X_0:bat[:str], X_1:bat[:lng], X_2:bat[:lng], X_3:bat[:timestamp], X_4:bat[:timestamp], X_5:bat[:lng], X_6:bat[:str]) SYSMONstatistics; (empty) -tokenizer -append -command tokenizer.append(X_0:str):oid -TKNZRappend; -tokenize a new string and append it to the tokenizer (duplicate elimination is performed) -tokenizer -close -command tokenizer.close():void -TKNZRclose; -close the current tokenizer store -tokenizer -depositFile -command tokenizer.depositFile(X_0:str):void -TKNZRdepositFile; -batch insertion from a file of strings to tokenize, each string is separated by a new line -tokenizer -getCardinality -command tokenizer.getCardinality():bat[:lng] -TKNZRgetCardinality; -debugging function that returns the unique tokens at each level -tokenizer -getCount -command tokenizer.getCount():bat[:lng] -TKNZRgetCount; -debugging function that returns the size of the bats at each level -tokenizer -getIndex -command tokenizer.getIndex():bat[:oid] -TKNZRgetIndex; -administrative function that returns the INDEX bat -tokenizer -getLevel -command tokenizer.getLevel(X_0:int):bat[:str] -TKNZRgetLevel; -administrative function that returns the bat on level i -tokenizer -locate -pattern tokenizer.locate(X_0:str):oid -TKNZRlocate; -if the given string is in the store returns its oid, otherwise oid_nil -tokenizer -open -command tokenizer.open(X_0:str):void -TKNZRopen; -open the named tokenizer store, a new one is created if the specified name does not exist -tokenizer -take -pattern tokenizer.take(X_0:oid):str -TKNZRtakeOid; -reconstruct and returns the i-th string txtsim dameraulevenshtein pattern txtsim.dameraulevenshtein(X_0:str, X_1:str):int diff --git a/common/stream/stream.h b/common/stream/stream.h --- a/common/stream/stream.h +++ b/common/stream/stream.h @@ -245,7 +245,7 @@ typedef struct bstream { stream_export bstream *bstream_create(stream *rs, size_t chunk_size); // used all over stream_export void bstream_destroy(bstream *s); // all over -stream_export ssize_t bstream_read(bstream *s, size_t size); // tablet.c, tokenizer.c +stream_export ssize_t bstream_read(bstream *s, size_t size); // tablet.c stream_export ssize_t bstream_next(bstream *s); // all over /* Callback stream is a stream where the read and write functions are diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -2077,7 +2077,7 @@ BBPdir_first(bool subcommit, lng logno, * replacing the entries for the subcommitted bats */ if ((obbpf =
MonetDB: groupjoin - merged with default
Changeset: 458c50c2e948 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/458c50c2e948 Branch: groupjoin Log Message: merged with default diffs (96 lines): diff --git a/sql/common/sql_types.c b/sql/common/sql_types.c --- a/sql/common/sql_types.c +++ b/sql/common/sql_types.c @@ -1540,7 +1540,7 @@ sqltypeinit( sql_allocator *sa) f->varres = 1; /* file_loader */ - f = sql_create_union(sa, "file_loader", "files", "", FALSE, SCALE_FIX, 0, TABLE, 1, STR); + f = sql_create_union(sa, "file_loader", "", "", TRUE, SCALE_FIX, 0, TABLE, 1, STR); f->varres = 1; /* sys_update_schemas, sys_update_tables */ diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -539,11 +539,15 @@ file_loader_add_table_column_types(mvc * return "Filename missing"; char *ext = strrchr(filename, '.'), *ep = ext; + if (ext) { ext=ext+1; ext = mkLower(sa_strdup(sql->sa, ext)); } + if (!ext) + return "extension missing"; + file_loader_t *fl = fl_find(ext); if (!fl) { /* maybe compressed */ @@ -567,7 +571,7 @@ file_loader_add_table_column_types(mvc * sql_subtype *st = sql_bind_localtype("str"); sql_exp *ext_exp = exp_atom(sql->sa, atom_string(sql->sa, st, ext)); if (!ext_exp) - return sql_error(sql, 02, SQLSTATE(HY013) MAL_MALLOC_FAIL); + return MAL_MALLOC_FAIL; append(exps, ext_exp); return NULL; } @@ -578,7 +582,7 @@ rel_file_loader(mvc *sql, list *exps, li sql_subfunc *f = NULL; bool found = false; - if ((f = bind_func_(sql, NULL, "file_loader", tl, F_UNION, false, ))) { + if ((f = bind_func_(sql, NULL, "file_loader", tl, F_UNION, true, ))) { list *nexps = exps; if (list_empty(tl) || f->func->vararg || (nexps = check_arguments_and_find_largest_any_type(sql, NULL, exps, f, 1))) { list *res_exps = sa_list(sql->sa); diff --git a/sql/test/emptydb/Tests/check.stable.out b/sql/test/emptydb/Tests/check.stable.out --- a/sql/test/emptydb/Tests/check.stable.out +++ b/sql/test/emptydb/Tests/check.stable.out @@ -1754,7 +1754,7 @@ select 'null in fkeys.delete_action', de [ "sys.functions", "sys", "evalalgebra", "SYSTEM", "create procedure sys.evalalgebra(ra_stmt string, opt bool) external name sql.\"evalAlgebra\";","sql", "MAL", "Procedure",true, false, false, true, NULL, "ra_stmt", "clob", 0, 0, "in", "opt", "boolean", 1, 0, "in", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL] [ "sys.functions", "sys", "exp", "SYSTEM", "exp", "mmath", "Internal C", "Scalar function", false, false, false, false, NULL, "res_0","double", 53, 0, "out", "arg_1", "double", 53, 0, "in", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL] [ "sys.functions", "sys", "exp", "SYSTEM", "exp", "mmath", "Internal C", "Scalar function", false, false, false, false, NULL, "res_0","real", 24, 0, "out", "arg_1","real", 24, 0, "in", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL] -[ "sys.functions", "sys",
MonetDB: groupjoin - merged with default
Changeset: 0a2fd9926975 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/0a2fd9926975 Modified Files: sql/backends/monet5/rel_bin.c sql/server/rel_exp.c Branch: groupjoin Log Message: merged with default diffs (truncated from 775 to 300 lines): diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -190,7 +190,7 @@ list_find_column(backend *be, list *l, c const char *nme = column_name(be->mvc->sa, s); if (rnme && strcmp(rnme, rname) == 0 && - strcmp(nme, name) == 0) { + strcmp(nme, name) == 0) { res = s; break; } @@ -601,7 +601,7 @@ exp_count_no_nil_arg(sql_exp *e, stmt *e while (as->type == st_alias) as = as->op1; /* use candidate */ - if (as && as->type == st_join && as->flag == cmp_project) { + if (as && as->type == st_join && as->flag == cmp_project) { if (as->op1 && (as->op1->type != st_result || as->op1->op1->type != st_group)) /* exclude a subquery with select distinct under the count */ as = as->op1; } @@ -911,7 +911,7 @@ exp2bin_casewhen(backend *be, sql_exp *f stmt *case_when = exp_bin(be, e, left, right, NULL, NULL, NULL, nsel, depth+1, 0, 1); if (!case_when) return NULL; - cmp = sql_bind_func(be->mvc, "sys", "=", exp_subtype(e), exp_subtype(e), F_FUNC, true); + cmp = sql_bind_func(be->mvc, "sys", "=", exp_subtype(e), exp_subtype(e), F_FUNC, true); if (!cmp) return NULL; if (!single_value && !case_when->nrcols) { @@ -1378,7 +1378,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l mvc *sql = be->mvc; stmt *s = NULL; - if (mvc_highwater(sql)) + if (mvc_highwater(sql)) return sql_error(be->mvc, 10, SQLSTATE(42000) "Query too complex: running out of stack space"); if (!e) { @@ -1429,7 +1429,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l return stmt_return(be, r, GET_PSM_LEVEL(e->flag)); } else if (e->flag & PSM_WHILE) { /* while is a if - block true with leave statement -* needed because the condition needs to be inside this outer block */ +* needed because the condition needs to be inside this outer block */ stmt *ifstmt = stmt_cond(be, stmt_bool(be, 1), NULL, 0, 0); stmt *cond = exp_bin(be, e->l, left, right, grp, ext, cnt, sel, 0, 0, push); stmt *wstmt; @@ -1479,15 +1479,15 @@ exp_bin(backend *be, sql_exp *e, stmt *l } break; case e_atom: { - if (e->l) { /* literals */ + if (e->l) { /* literals */ s = stmt_atom(be, e->l); - } else if (e->r) { /* parameters and declared variables */ + } else if (e->r) { /* parameters and declared variables */ sql_var_name *vname = (sql_var_name*) e->r; assert(vname->name); s = stmt_var(be, vname->sname ? sa_strdup(sql->sa, vname->sname) : NULL, sa_strdup(sql->sa, vname->name), e->tpe.type?>tpe:NULL, 0, e->flag); - } else if (e->f) { /* values */ + } else if (e->f) { /* values */ s = value_list(be, e->f, left, sel); - } else {/* arguments */ + } else {/* arguments */ sql_subtype *t = e->tpe.type?>tpe:NULL; if (!t && 0) { sql_arg *a = sql_bind_paramnr(be->mvc, e->flag); @@ -1513,7 +1513,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l if (!l) return NULL; s = stmt_convert(be, l, (!push&>nrcols==0)?NULL:sel, from, to); - } break; + } break; case e_func: { node *en; list *l = sa_list(sql->sa), *exps = e->l; @@ -1581,7 +1581,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l } if (!(s = stmt_Nop(be, stmt_list(be, l), sel, f, rows))) return NULL; - } break; + } break; case e_aggr: { list *attr = e->l; stmt *as = NULL; @@ -1658,7 +1658,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l s = stmt_aggr(be, as,
MonetDB: groupjoin - merged with default
Changeset: aad47eed5d12 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/aad47eed5d12 Branch: groupjoin Log Message: merged with default diffs (283 lines): diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c --- a/clients/mapiclient/mhelp.c +++ b/clients/mapiclient/mhelp.c @@ -673,9 +673,9 @@ SQLhelp sqlhelp2[] = { NULL}, {"generated_column", NULL, -"AUTO_INCREMENT | GENERATED ALWAYS AS IDENTITY [ '(' [ AS data_type] [ START [WITH start]] [INCREMENT BY increment]\n" -"[MINVALUE minvalue | NO MINVALUE] [MAXVALUE maxvalue | NO MAXVALUE] [CACHE cachevalue] [[NO] CYCLE] ')' ] ", -"data_type", +"AUTO_INCREMENT | GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY [ '(' [ AS seq_int_datatype] [ START [WITH start]]\n" +" [INCREMENT BY increment] [MINVALUE minvalue | NO MINVALUE] [MAXVALUE maxvalue | NO MAXVALUE] [CACHE cachevalue] [[NO] CYCLE] ')' ]", +"seq_int_datatype", "See also https://www.monetdb.org/documentation/user-guide/sql-manual/data-types/serial-types/"}, {"global_privileges", NULL, diff --git a/sql/ChangeLog b/sql/ChangeLog --- a/sql/ChangeLog +++ b/sql/ChangeLog @@ -16,6 +16,12 @@ Note: MonetDB does NOT support catalog qualifiers in object names, so all the _CATALOG columns in these information_schema views will allways contain NULL. +* Mon Aug 21 2023 Niels Nes +- Added support for generated column syntax: + GENERATED BY DEFAULT AS IDENTITY ... + This allows the user to override the default generated sequence value + during inserts. + * Fri Jul 7 2023 Niels Nes - Added SQL support for: and in ::= diff --git a/sql/common/sql_types.c b/sql/common/sql_types.c --- a/sql/common/sql_types.c +++ b/sql/common/sql_types.c @@ -1540,7 +1540,7 @@ sqltypeinit( sql_allocator *sa) f->varres = 1; /* file_loader */ - f = sql_create_union(sa, "file_loader", "", "", FALSE, SCALE_FIX, 0, TABLE, 1, STR); + f = sql_create_union(sa, "file_loader", "files", "", FALSE, SCALE_FIX, 0, TABLE, 1, STR); f->varres = 1; /* sys_update_schemas, sys_update_tables */ diff --git a/sql/server/rel_file_loader.c b/sql/server/rel_file_loader.c --- a/sql/server/rel_file_loader.c +++ b/sql/server/rel_file_loader.c @@ -1,3 +1,12 @@ +/* + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Copyright 1997 - July 2008 CWI, August 2008 - 2023 MonetDB B.V. + */ #include "monetdb_config.h" #include "rel_file_loader.h" @@ -8,7 +17,7 @@ static file_loader_t file_loaders[NR_FIL void fl_exit(void) { - for (int i = 0; iname); - fl->name = NULL; + GDKfree(fl->name); + fl->name = NULL; } } @@ -29,13 +37,13 @@ int fl_register(char *name, fl_add_types_fptr add_types, fl_load_fptr load) { file_loader_t *fl = fl_find(name); - if (fl) { printf("re-registering %s\n", name); GDKfree(fl->name); fl->name = NULL; } - for (int i = 0; ih->data; if (!exp_is_atom(file)) return "Filename missing"; + atom *a = file->l; if (a->data.vtype != TYPE_str || !a->data.val.sval) return "Filename missing"; + char *filename = a->data.val.sval; + if (strcmp(filename, "") == 0) + return "Filename missing"; + char *ext = strrchr(filename, '.'), *ep = ext; - if (ext) { ext=ext+1; ext = mkLower(sa_strdup(sql->sa, ext)); @@ -563,7 +567,7 @@ file_loader_add_table_column_types(mvc * sql_subtype *st = sql_bind_localtype("str"); sql_exp *ext_exp = exp_atom(sql->sa, atom_string(sql->sa, st, ext)); if (!ext_exp) - return sql_error(sql, 02, SQLSTATE(HY013) MAL_MALLOC_FAIL); + return sql_error(sql, 02, SQLSTATE(HY013) MAL_MALLOC_FAIL); append(exps, ext_exp); return NULL; } diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y --- a/sql/server/sql_parser.y +++ b/sql/server/sql_parser.y @@ -1906,6 +1906,7 @@ column_def: } | column serial_or_bigserial { /* SERIAL = INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY */ + /* BIGSERIAL = BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY */ /* handle multi-statements by wrapping them in a list */ sql_subtype it; dlist* stmts; diff --git a/sql/test/emptydb/Tests/check.stable.out b/sql/test/emptydb/Tests/check.stable.out --- a/sql/test/emptydb/Tests/check.stable.out +++ b/sql/test/emptydb/Tests/check.stable.out @@ -1754,7 +1754,7 @@ select 'null in fkeys.delete_action', de
MonetDB: groupjoin - merged with default
Changeset: b74244ccf9ff for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/b74244ccf9ff Branch: groupjoin Log Message: merged with default diffs (144 lines): diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -7,3 +7,9 @@ During the upgrade function definitions will fallback to the normal PYTHON language option. +* Mon Jul 17 2023 Panagiotis Koutsourakis +- Implemented direct masking for strimp construction. The strimps + datastructure now keeps an array of 65K 64-bit integers that is zero + everywhere except at the indexes that correspond to header pairs. The + entry for the nth pair in order has the nth bit of the bitstring + on. These can be used to quickly construct bitstrings. diff --git a/ChangeLog.strimps-updates b/ChangeLog.strimps-updates deleted file mode 100644 --- a/ChangeLog.strimps-updates +++ /dev/null @@ -1,10 +0,0 @@ -# ChangeLog file for strimpsv2 -# This file is updated with Maddlog - -* Mon Jul 17 2023 Panagiotis Koutsourakis -- Implemented direct masking for strimp construction. The strimps - datastructure now keeps an array of 65K 64-bit integers that is zero - everywhere except at the indexes that correspond to header pairs. The - entry for the nth pair in order has the nth bit of the bitstring - on. These can be used to quickly construct bitstrings. - diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c --- a/monetdb5/mal/mal_dataflow.c +++ b/monetdb5/mal/mal_dataflow.c @@ -82,7 +82,7 @@ typedef struct DATAFLOW { struct worker { MT_Id id; - enum { WAITING, RUNNING, FREE, EXITED } flag; + enum { WAITING, RUNNING, FREE, EXITED, FINISHING } flag; ATOMIC_PTR_TYPE cntxt; /* client we do work for (NULL -> any) */ MT_Sema s; struct worker *next; @@ -245,6 +245,7 @@ static void DFLOWworker(void *T) { struct worker *t = (struct worker *) T; + bool locked = false; #ifdef _MSC_VER srand((unsigned int) GDKusec()); #endif @@ -411,20 +412,8 @@ DFLOWworker(void *T) } } MT_lock_set(); - if (GDKexiting() || ATOMIC_GET()) { - MT_lock_unset(); - break; - } - if (free_count >= free_max) { - struct worker **tp = - while (*tp && *tp != t) - tp = &(*tp)->next; - assert(*tp && *tp == t); - *tp = t->next; - t->flag = EXITED; - t->next = exited_workers; - exited_workers = t; - MT_lock_unset(); + if (GDKexiting() || ATOMIC_GET() || free_count >= free_max) { + locked = true; break; } free_count++; @@ -442,6 +431,19 @@ DFLOWworker(void *T) break; assert(t->flag == WAITING); } + if (!locked) + MT_lock_set(); + if (t->flag != FINISHING) { + struct worker **tp = t->flag == FREE ? _workers : + while (*tp && *tp != t) + tp = &(*tp)->next; + assert(*tp && *tp == t); + *tp = t->next; + t->flag = EXITED; + t->next = exited_workers; + exited_workers = t; + } + MT_lock_unset(); GDKsetbuf(NULL); } @@ -747,6 +749,7 @@ DFLOWscheduler(DataFlow flow, struct wor static inline void finish_worker(struct worker *t) { + t->flag = FINISHING; MT_lock_unset(); MT_join_thread(t->id); MT_sema_destroy(>s); @@ -944,6 +947,8 @@ stopMALdataflow(void) } while (free_workers) { struct worker *t = free_workers; + assert(free_count > 0); + free_count--; free_workers = free_workers->next; MT_sema_up(>s); finish_worker(t); @@ -953,6 +958,11 @@ stopMALdataflow(void) workers = workers->next; finish_worker(t); } + while (exited_workers) { + struct worker *t = exited_workers; + exited_workers = exited_workers->next; + finish_worker(t); + } MT_lock_unset(); } } diff --git a/sql/test/BugTracker-2020/Tests/All b/sql/test/BugTracker-2020/Tests/All --- a/sql/test/BugTracker-2020/Tests/All +++ b/sql/test/BugTracker-2020/Tests/All @@ -26,7 +26,7 @@ table-udf-column-descriptor.Bug-6964 table-udf-distinct.Bug-6965 table-udf-on-remote.Bug-6971 integers-intervals.Bug-6979 -KNOWNFAIL?wrong-key-error.Bug-6982 +wrong-key-error.Bug-6982 window-function-order.Bug-6997 semijoin.Bug-7001
MonetDB: groupjoin - merged with default
Changeset: d83343a770f8 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/d83343a770f8 Modified Files: clients/Tests/exports.stable.out gdk/gdk.h sql/backends/monet5/sql_scenario.c sql/test/sql_dump/Tests/dump.test Branch: groupjoin Log Message: merged with default diffs (truncated from 18241 to 300 lines): diff --git a/README.rst b/README.rst --- a/README.rst +++ b/README.rst @@ -61,35 +61,35 @@ the first of the ``cmake`` command lines otherwise, options are ``ON`` when the relevant libraries can be found. Available options are: -== === -Option Explanation -== === -ASSERT Enable asserts (default=ON for development sources, OFF for tarball installation) -CINTEGRATIONEnable support for C UDFs (default=ON except on Windows) -CMAKE_SUMMARY Show a summary of the cmake configuration (for debug purposes, default=OFF) -CMAKE_UNITTEST Build and run the unittest for the build system (default=OFF) -FITSEnable support for FITS -GEOMEnable support for geom module -INT128 Enable support for 128-bit integers -NETCDF Enable support for netcdf -ODBCCompile the MonetDB ODBC driver -PY3INTEGRATION Enable support for Python 3 integration into MonetDB -RINTEGRATIONEnable support for R integration into MonetDB -SANITIZER Enable support for the GCC address sanitizer (default=OFF) -SHP Enable support for ESRI Shapefiles -STRICT Enable strict compiler flags (default=ON for development sources, OFF for tarball installation) -TESTING Enable support for testing -WITH_BZ2Include bz2 support -WITH_CMOCKA Include cmocka support (default=OFF) -WITH_CURL Include curl support -WITH_LZMA Include lzma support -WITH_PCRE Include pcre support -WITH_PROJ Include proj support -WITH_READLINE Include readline support -WITH_VALGRIND Include valgrind support -WITH_XML2 Include xml2 support -WITH_ZLIB Include zlib support -== === += === +Option Explanation += === +ASSERT Enable asserts (default=ON for development sources, OFF for tarball installation) +CINTEGRATIONEnable support for C UDFs (default=ON except on Windows) +CMAKE_SUMMARY Show a summary of the cmake configuration (for debug purposes, default=OFF) +CMAKE_UNITTESTS Build and run the unittest for the build system (default=OFF) +FITSEnable support for FITS +GEOMEnable support for geom module +INT128 Enable support for 128-bit integers +NETCDF Enable support for netcdf +ODBCCompile the MonetDB ODBC driver +PY3INTEGRATION Enable support for Python 3 integration into MonetDB +RINTEGRATIONEnable support for R integration into MonetDB +SANITIZER Enable support for the GCC address sanitizer (default=OFF) +SHP Enable support for ESRI Shapefiles +STRICT Enable strict compiler flags (default=ON for development sources, OFF for tarball installation) +TESTING Enable support for testing +WITH_BZ2Include bz2 support +WITH_CMOCKA Include cmocka support (default=OFF) +WITH_CURL Include curl support +WITH_LZMA Include lzma support +WITH_PCRE Include pcre support +WITH_PROJ Include proj support +WITH_READLINE Include readline support +WITH_VALGRIND Include valgrind support +WITH_XML2 Include xml2 support +WITH_ZLIB Include zlib support += === Required and Optional Packages .. 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 @@ -277,6 +277,7 @@ bit GDKfataljumpenable; str GDKfatalmsg; char *GDKfilepath(int farmid, const char *dir, const char *nme, const char *ext); void GDKfree(void *blk); +char *GDKgetbuf(void); unsigned GDKgetdebug(void); const char *GDKgetenv(const char *name); int GDKgetenv_int(const char *name, int def); @@ -307,9 +308,12 @@ void GDKqsort(void *restrict h, void *re void *GDKrealloc(void *pold, size_t size) __attribute__((__alloc_size__(2))) __attribute__((__warn_unused_result__)); gdk_return
MonetDB: groupjoin - merged with default
Changeset: f9c1199a8e5e for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/f9c1199a8e5e Modified Files: clients/Tests/exports.stable.out gdk/gdk.h sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_scenario.c sql/backends/monet5/sql_statement.c sql/server/rel_unnest.c Branch: groupjoin Log Message: merged with default diffs (truncated from 6300 to 300 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -808,3 +808,4 @@ aba8c31c60480148cd388a09ac99b42679406258 79dbf838f04483a2d9ccce8332090ff91b18caec Jun2023_3 79dbf838f04483a2d9ccce8332090ff91b18caec Jun2023_release 573511e0e7bf2f7ab11f00b45711aab5f1aff6f2 Jun2023_5 +573511e0e7bf2f7ab11f00b45711aab5f1aff6f2 Jun2023_SP1_release diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ # ChangeLog file for devel # This file is updated with Maddlog +* Thu Jul 27 2023 Niels Nes +- Removed the PYTHON MAP external language option, as after a fork the + synchronization primitives could be in any state, leading to deadlocks. + During the upgrade function definitions will fallback to the normal + PYTHON language option. + 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 @@ -523,9 +523,7 @@ ssize_t fltToStr(str *dst, size_t *len, const flt flt_nil; gdk_return gdk_add_callback(char *name, gdk_callback_func *f, int argc, void *argv[], int interval); gdk_return gdk_remove_callback(char *, gdk_callback_func *f); -lng getBBPlogno(void); bat getBBPsize(void); -lng getBBPtransid(void); char *get_bin_path(void); int gettimeofday(struct timeval *tv, int *ignore_zone); struct tm *gmtime_r(const time_t *restrict, struct tm *restrict); diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -2432,20 +2432,32 @@ gdk_export BAT *BATsample_with_seed(BAT * on each iteration */ #define TIMEOUT_LOOP_IDX(IDX, REPEATS, TIMEOFFSET) \ for (BUN REPS = (IDX = 0, (REPEATS)); REPS > 0; REPS = 0) /* "loops" at most once */ \ - for (BUN CTR1 = 0, END1 = (REPS + CHECK_QRY_TIMEOUT_STEP) >> CHECK_QRY_TIMEOUT_SHIFT; CTR1 < END1 && TIMEOFFSET >= 0; CTR1++, TIMEOFFSET = GDKexiting() || (TIMEOFFSET > 0 && GDKusec() > TIMEOFFSET) ? -1 : TIMEOFFSET) \ - for (BUN CTR2 = 0, END2 = CTR1 == END1 - 1 ? REPS & CHECK_QRY_TIMEOUT_MASK : CHECK_QRY_TIMEOUT_STEP; CTR2 < END2; CTR2++, IDX++) + for (BUN CTR1 = 0, END1 = (REPS + CHECK_QRY_TIMEOUT_STEP) >> CHECK_QRY_TIMEOUT_SHIFT; CTR1 < END1 && TIMEOFFSET >= 0; CTR1++) \ + if (GDKexiting() || (TIMEOFFSET > 0 && GDKusec() > TIMEOFFSET)) { \ + TIMEOFFSET = -1;\ + break; \ + } else \ + for (BUN CTR2 = 0, END2 = CTR1 == END1 - 1 ? REPS & CHECK_QRY_TIMEOUT_MASK : CHECK_QRY_TIMEOUT_STEP; CTR2 < END2; CTR2++, IDX++) /* declare and use IDX as a loop variable, initializing it to 0 and * incrementing it on each iteration */ #define TIMEOUT_LOOP_IDX_DECL(IDX, REPEATS, TIMEOFFSET) \ for (BUN IDX = 0, REPS = (REPEATS); REPS > 0; REPS = 0) /* "loops" at most once */ \ - for (BUN CTR1 = 0, END1 = (REPS + CHECK_QRY_TIMEOUT_STEP) >> CHECK_QRY_TIMEOUT_SHIFT; CTR1 < END1 && TIMEOFFSET >= 0; CTR1++, TIMEOFFSET = GDKexiting() || (TIMEOFFSET > 0 && GDKusec() > TIMEOFFSET) ? -1 : TIMEOFFSET) \ - for (BUN CTR2 = 0, END2 = CTR1 == END1 - 1 ? REPS & CHECK_QRY_TIMEOUT_MASK : CHECK_QRY_TIMEOUT_STEP; CTR2 < END2; CTR2++, IDX++) + for (BUN CTR1 = 0, END1 = (REPS + CHECK_QRY_TIMEOUT_STEP) >> CHECK_QRY_TIMEOUT_SHIFT; CTR1 < END1 && TIMEOFFSET >= 0; CTR1++) \ + if (GDKexiting() || (TIMEOFFSET > 0 && GDKusec() > TIMEOFFSET)) { \ + TIMEOFFSET = -1;\ + break; \ + } else \ + for (BUN CTR2 = 0, END2 = CTR1 == END1 - 1 ? REPS & CHECK_QRY_TIMEOUT_MASK : CHECK_QRY_TIMEOUT_STEP; CTR2 < END2; CTR2++, IDX++) /* there is no user-visible loop variable */ #define TIMEOUT_LOOP(REPEATS, TIMEOFFSET) \ - for (BUN CTR1 = 0, REPS = (REPEATS), END1 = (REPS + CHECK_QRY_TIMEOUT_STEP) >> CHECK_QRY_TIMEOUT_SHIFT; CTR1 < END1 && TIMEOFFSET >= 0; CTR1++, TIMEOFFSET = GDKexiting() || (TIMEOFFSET > 0 && GDKusec() > TIMEOFFSET) ? -1 : TIMEOFFSET) \ - for (BUN CTR2 = 0, END2 = CTR1 == END1 - 1 ? REPS & CHECK_QRY_TIMEOUT_MASK : CHECK_QRY_TIMEOUT_STEP; CTR2 < END2; CTR2++) + for (BUN CTR1
MonetDB: groupjoin - merged with default
Changeset: 9edd67ac8c81 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/9edd67ac8c81 Branch: groupjoin Log Message: merged with default diffs (truncated from 1206 to 300 lines): diff --git a/monetdb5/mal/mal_module.c b/monetdb5/mal/mal_module.c --- a/monetdb5/mal/mal_module.c +++ b/monetdb5/mal/mal_module.c @@ -123,11 +123,15 @@ mal_module_reset(void) } } -static int getModuleIndex(const char *name) { +static int +getModuleIndex(const char *name) +{ return (int) (strHash(name) % MODULE_HASH_SIZE); } -static void clrModuleIndex(Module cur){ +static void +clrModuleIndex(Module cur) +{ int index = getModuleIndex(cur->name); Module prev = NULL; Module m = moduleIndex[index]; @@ -145,16 +149,20 @@ static void clrModuleIndex(Module cur){ } } -static void addModuleToIndex(Module cur){ +static void +addModuleToIndex(Module cur) +{ int index = getModuleIndex(cur->name); cur->link = moduleIndex[index]; moduleIndex[index] = cur; } -Module getModule(const char *name) { +Module +getModule(const char *name) +{ int index = getModuleIndex(name); Module m = moduleIndex[index]; - while(m) { + while (m) { if (name == m->name) return m; m = m->link; @@ -162,7 +170,9 @@ Module getModule(const char *name) { return NULL; } -void getModuleList(Module** out, int* length) { +void +getModuleList(Module** out, int* length) +{ int i; int moduleCount = 0; int currentIndex = 0; @@ -188,7 +198,9 @@ void getModuleList(Module** out, int* le } } -void freeModuleList(Module* list) { +void +freeModuleList(Module* list) +{ GDKfree(list); } @@ -196,11 +208,13 @@ void freeModuleList(Module* list) { * Module scope management * It will contain the symbol table of all globally accessible functions. */ -Module globalModule(const char *nme) -{ Module cur; +Module +globalModule(const char *nme) +{ + Module cur; // Global modules are not named 'user' - assert (strcmp(nme, "user")); + assert(strcmp(nme, "user")); nme = putName(nme); cur = (Module) GDKzalloc(sizeof(ModuleRecord)); if (cur == NULL) @@ -218,7 +232,9 @@ Module globalModule(const char *nme) /* Every client record has a private module name 'user' * for keeping around non-shared functions */ -Module userModule(void){ +Module +userModule(void) +{ Module cur; cur = (Module) GDKzalloc(sizeof(ModuleRecord)); @@ -238,7 +254,9 @@ Module userModule(void){ * The scope can be fixed. This is used by the parser. * Reading a module often calls for creation first. */ -Module fixModule(const char *nme) { +Module +fixModule(const char *nme) +{ Module m; m = getModule(nme); @@ -249,7 +267,8 @@ Module fixModule(const char *nme) { * The freeModule operation throws away a symbol without * concerns on it whereabouts in the scope structure. */ -static void freeSubScope(Module scope) +static void +freeSubScope(Module scope) { int i; Symbol s; @@ -267,7 +286,8 @@ static void freeSubScope(Module scope) scope->space = 0; } -void freeModule(Module m) +void +freeModule(Module m) { Symbol s; @@ -300,7 +320,9 @@ void freeModule(Module m) * This speeds up searching provided the modules adhere to the * structure and group the functions as well. */ -void insertSymbol(Module scope, Symbol prg){ +void +insertSymbol(Module scope, Symbol prg) +{ InstrPtr sig; int t; Module c; @@ -341,7 +363,9 @@ void insertSymbol(Module scope, Symbol p * moment of removal. This situation can not easily * checked at runtime, without tremendous overhead. */ -void deleteSymbol(Module scope, Symbol prg){ +void +deleteSymbol(Module scope, Symbol prg) +{ InstrPtr sig; int t; @@ -379,7 +403,9 @@ void deleteSymbol(Module scope, Symbol p * The 'user' module is an alias for the scope attached * to the current user. */ -Module findModule(Module scope, const char *name){ +Module +findModule(Module scope, const char *name) +{ Module def = scope; Module m; if (name == NULL) return scope; @@ -402,7 +428,9 @@ Module findModule(Module scope, const ch * The variation on this routine is to dump the definition of * all matching definitions. */ -Symbol findSymbolInModule(Module v, const char *fcn) { +Symbol +findSymbolInModule(Module v, const char *fcn) +{ Symbol s; if (v == NULL || fcn == NULL) return NULL; s = v->space[(int)(*fcn)]; @@ -413,7 +441,9 @@ Symbol findSymbolInModule(Module v, cons return NULL; } -Symbol findSymbol(Module usermodule, const char *mod, const char *fcn) { +Symbol +findSymbol(Module usermodule, const char *mod, const char *fcn) +{ Module m = findModule(usermodule, mod); return findSymbolInModule(m, fcn); } diff
MonetDB: groupjoin - merged with default
Changeset: 8638f7f6521b for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/8638f7f6521b Modified Files: clients/Tests/exports.stable.out Branch: groupjoin Log Message: merged with default diffs (truncated from 3967 to 300 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -807,3 +807,4 @@ 8b736d6dcfd63d0560c99fc5427b504c116b74b0 aba8c31c60480148cd388a09ac99b42679406258 Jun2023_1 79dbf838f04483a2d9ccce8332090ff91b18caec Jun2023_3 79dbf838f04483a2d9ccce8332090ff91b18caec Jun2023_release +573511e0e7bf2f7ab11f00b45711aab5f1aff6f2 Jun2023_5 diff --git a/ChangeLog.strimps-updates b/ChangeLog.strimps-updates new file mode 100644 --- /dev/null +++ b/ChangeLog.strimps-updates @@ -0,0 +1,10 @@ +# ChangeLog file for strimpsv2 +# This file is updated with Maddlog + +* Mon Jul 17 2023 Panagiotis Koutsourakis +- Implemented direct masking for strimp construction. The strimps + datastructure now keeps an array of 65K 64-bit integers that is zero + everywhere except at the indexes that correspond to header pairs. The + entry for the nth pair in order has the nth bit of the bitstring + on. These can be used to quickly construct bitstrings. + diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -89,7 +89,7 @@ Group: Applications/Databases License: MPL-2.0 URL: https://www.monetdb.org/ BugURL: https://github.com/MonetDB/MonetDB/issues -Source: https://www.monetdb.org/downloads/sources/Jun2023/%{name}-%{version}.tar.bz2 +Source: https://www.monetdb.org/downloads/sources/Jun2023-SP1/%{name}-%{version}.tar.bz2 # The Fedora packaging document says we need systemd-rpm-macros for # the _unitdir and _tmpfilesdir macros to exist; however on RHEL 7 @@ -860,6 +860,24 @@ fi %endif %changelog +* Tue Jul 18 2023 Sjoerd Mullender - 11.47.5-20230718 +- Rebuilt. +- GH#7388: Query results in large cross product +- GH#7394: BBPextend: ERROR: trying to extend BAT pool beyond the limit + (16384) + +* Thu Jun 22 2023 Sjoerd Mullender - 11.47.5-20230718 +- sql: An upgrade that both creates a new .snapshot user and extends the + sys.db_user_info table with (among others) a password column did + these in such a way that the passord value for the new user was NULL. + This is fixed by updating the password. + +* Thu Jun 22 2023 Sjoerd Mullender - 11.47.5-20230718 +- monetdb5: There is now a new option --set tablet_threads=N to limit the number + of threads used for a COPY INTO from CSV file query. This option can + also be set for a specific database using the monetdb command using + the ncopyintothreads property. + * Thu Jun 22 2023 Sjoerd Mullender - 11.47.3-20230622 - Rebuilt. - GH#7344: Database upgrade failure due to user object dependency on 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 @@ -301,6 +301,7 @@ int GDKms(void); gdk_return GDKmunmap(void *addr, size_t len); int GDKnr_threads; void GDKprepareExit(void); +void GDKprintinfo(void); void GDKqsort(void *restrict h, void *restrict t, const void *restrict base, size_t n, int hs, int ts, int tpe, bool reverse, bool nilslast); void *GDKrealloc(void *pold, size_t size) __attribute__((__alloc_size__(2))) __attribute__((__warn_unused_result__)); gdk_return GDKrebuild_segment_tree(oid ncount, oid data_size, BAT *st, void **segment_tree, oid **levels_offset, oid *nlevels); diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c --- a/clients/mapiclient/mhelp.c +++ b/clients/mapiclient/mhelp.c @@ -743,7 +743,7 @@ SQLhelp sqlhelp2[] = { NULL}, {"language_keyword", NULL, -"C | CPP | R | PYTHON | PYTHON_MAP | PYTHON3 | PYTHON3_MAP", +"C | CPP | R | PYTHON | PYTHON3", NULL, NULL}, {"match_options", diff --git a/cmake/monetdb-versions.cmake b/cmake/monetdb-versions.cmake --- a/cmake/monetdb-versions.cmake +++ b/cmake/monetdb-versions.cmake @@ -42,7 +42,7 @@ set(MONETDB_VERSION "${MONETDB_VERSION_M # common/options and common/utils) set(GDK_VERSION_MAJOR "27") set(GDK_VERSION_MINOR "0") -set(GDK_VERSION_PATCH "1") +set(GDK_VERSION_PATCH "2") set(GDK_VERSION "${GDK_VERSION_MAJOR}.${GDK_VERSION_MINOR}.${GDK_VERSION_PATCH}") # version of the MAPI library (subdirectory clients/mapilib) @@ -54,13 +54,13 @@ set(MAPI_VERSION "${MAPI_VERSION_MAJOR}. # version of the MONETDB5 library (subdirectory monetdb5, not including extras or sql) set(MONETDB5_VERSION_MAJOR "34") set(MONETDB5_VERSION_MINOR "0") -set(MONETDB5_VERSION_PATCH "1") +set(MONETDB5_VERSION_PATCH "2") set(MONETDB5_VERSION "${MONETDB5_VERSION_MAJOR}.${MONETDB5_VERSION_MINOR}.${MONETDB5_VERSION_PATCH}") # version of the MONETDBE library (subdirectory tools/monetdbe) set(MONETDBE_VERSION_MAJOR "26") set(MONETDBE_VERSION_MINOR "0") -set(MONETDBE_VERSION_PATCH "2") +set(MONETDBE_VERSION_PATCH "3") set(MONETDBE_VERSION
MonetDB: groupjoin - merged with default
Changeset: 22d7cf63b12b for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/22d7cf63b12b Modified Files: clients/Tests/MAL-signatures-hge.test clients/Tests/MAL-signatures.test clients/Tests/exports.stable.out monetdb5/optimizer/opt_mergetable.c monetdb5/optimizer/opt_prelude.c monetdb5/optimizer/opt_prelude.h monetdb5/optimizer/opt_support.c sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_scenario.c sql/backends/monet5/sql_statement.c sql/server/rel_optimizer.c sql/server/rel_unnest.c Branch: groupjoin Log Message: merged with default diffs (truncated from 15452 to 300 lines): diff --git a/ChangeLog.Sep2022 b/ChangeLog.Sep2022 deleted file mode 100644 --- a/ChangeLog.Sep2022 +++ /dev/null @@ -1,3 +0,0 @@ -# ChangeLog file for devel -# This file is updated with Maddlog - diff --git a/clients/ChangeLog.Sep2022 b/clients/ChangeLog.Sep2022 deleted file mode 100644 --- a/clients/ChangeLog.Sep2022 +++ /dev/null @@ -1,3 +0,0 @@ -# ChangeLog file for clients -# This file is updated with Maddlog - diff --git a/clients/Tests/MAL-signatures-hge.test b/clients/Tests/MAL-signatures-hge.test --- a/clients/Tests/MAL-signatures-hge.test +++ b/clients/Tests/MAL-signatures-hge.test @@ -33483,21 +33483,6 @@ subeval_aggr unsafe pattern batpyapi3.subeval_aggr(X_0:ptr, X_1:str, X_2:any...):any... PYAPI3PyAPIevalAggr; grouped aggregates through Python -batpyapi3map -eval -pattern batpyapi3map.eval(X_0:ptr, X_1:str, X_2:any...):any... -PYAPI3PyAPIevalStdMap; -Execute a simple Python script value -batpyapi3map -eval_aggr -pattern batpyapi3map.eval_aggr(X_0:ptr, X_1:str, X_2:any...):any... -PYAPI3PyAPIevalAggrMap; -grouped aggregates through Python -batpyapi3map -subeval_aggr -pattern batpyapi3map.subeval_aggr(X_0:ptr, X_1:str, X_2:any...):any... -PYAPI3PyAPIevalAggrMap; -grouped aggregates through Python batrapi eval pattern batrapi.eval(X_0:lng, X_1:ptr, X_2:str):any... @@ -48824,6 +48809,11 @@ unsafe pattern profiler.stoptrace():void CMDstopTrace; Stop collecting trace information pyapi3 +epilogue +command pyapi3.epilogue():void +PyAPI3epilogue; +(empty) +pyapi3 eval unsafe pattern pyapi3.eval(X_0:ptr, X_1:str):any_1 PYAPI3PyAPIevalStd; @@ -48849,30 +48839,15 @@ unsafe pattern pyapi3.eval_loader(X_0:pt PYAPI3PyAPIevalLoader; loader functions through Python pyapi3 +prelude +pattern pyapi3.prelude():void +PyAPI3prelude; +(empty) +pyapi3 subeval_aggr unsafe pattern pyapi3.subeval_aggr(X_0:ptr, X_1:str, X_2:any...):any... PYAPI3PyAPIevalAggr; grouped aggregates through Python -pyapi3map -eval -pattern pyapi3map.eval(X_0:ptr, X_1:str):any -PYAPI3PyAPIevalStdMap; -Execute a simple Python script returning a single value -pyapi3map -eval -pattern pyapi3map.eval(X_0:ptr, X_1:str, X_2:any...):any... -PYAPI3PyAPIevalStdMap; -Execute a simple Python script value -pyapi3map -eval_aggr -pattern pyapi3map.eval_aggr(X_0:ptr, X_1:str, X_2:any...):any... -PYAPI3PyAPIevalAggrMap; -grouped aggregates through Python -pyapi3map -subeval_aggr -pattern pyapi3map.subeval_aggr(X_0:ptr, X_1:str, X_2:any...):any... -PYAPI3PyAPIevalAggrMap; -grouped aggregates through Python querylog append pattern querylog.append(X_0:str, X_1:str, X_2:str, X_3:timestamp):void diff --git a/clients/Tests/MAL-signatures.test b/clients/Tests/MAL-signatures.test --- a/clients/Tests/MAL-signatures.test +++ b/clients/Tests/MAL-signatures.test @@ -24678,21 +24678,6 @@ subeval_aggr unsafe pattern batpyapi3.subeval_aggr(X_0:ptr, X_1:str, X_2:any...):any... PYAPI3PyAPIevalAggr; grouped aggregates through Python -batpyapi3map -eval -pattern batpyapi3map.eval(X_0:ptr, X_1:str, X_2:any...):any... -PYAPI3PyAPIevalStdMap; -Execute a simple Python script value -batpyapi3map -eval_aggr -pattern batpyapi3map.eval_aggr(X_0:ptr, X_1:str, X_2:any...):any... -PYAPI3PyAPIevalAggrMap; -grouped aggregates through Python -batpyapi3map -subeval_aggr -pattern batpyapi3map.subeval_aggr(X_0:ptr, X_1:str, X_2:any...):any... -PYAPI3PyAPIevalAggrMap; -grouped aggregates through Python batrapi eval pattern batrapi.eval(X_0:lng, X_1:ptr, X_2:str):any... @@ -37254,6 +37239,11 @@ unsafe pattern profiler.stoptrace():void CMDstopTrace; Stop collecting trace information pyapi3 +epilogue +command pyapi3.epilogue():void +PyAPI3epilogue; +(empty) +pyapi3 eval unsafe pattern pyapi3.eval(X_0:ptr, X_1:str):any_1 PYAPI3PyAPIevalStd; @@ -37279,30 +37269,15 @@ unsafe pattern pyapi3.eval_loader(X_0:pt PYAPI3PyAPIevalLoader; loader functions through Python pyapi3 +prelude +pattern pyapi3.prelude():void +PyAPI3prelude; +(empty) +pyapi3 subeval_aggr unsafe pattern pyapi3.subeval_aggr(X_0:ptr, X_1:str, X_2:any...):any... PYAPI3PyAPIevalAggr; grouped aggregates through Python -pyapi3map -eval -pattern pyapi3map.eval(X_0:ptr, X_1:str):any -PYAPI3PyAPIevalStdMap; -Execute a simple Python script returning a single value -pyapi3map -eval -pattern