Changeset: 4a9fa50958d6 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/4a9fa50958d6 Modified Files: gdk/gdk.h gdk/gdk_batop.c gdk/gdk_bbp.c sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_upgrades.c sql/server/rel_exp.c sql/server/rel_exp.h sql/server/rel_optimizer.c sql/server/rel_rel.c sql/server/rel_rel.h sql/server/rel_rewriter.c sql/server/rel_select.c sql/server/sql_atom.c sql/storage/bat/bat_storage.c sql/storage/store.c sql/test/SQLancer/Tests/sqlancer19.SQL.py Branch: properties Log Message:
Merged with default diffs (truncated from 185461 to 300 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -754,3 +754,7 @@ 97e76b882f9fb28327393d21708fb22f2f6c22f1 f458e1c71c73d6bd9636369c1406eadb74f016bf Jan2022_9 f458e1c71c73d6bd9636369c1406eadb74f016bf Jan2022_SP1_release 00463fdd0d51d7ce058549a82bc74efaea6035a2 Jul2021_15 +00463fdd0d51d7ce058549a82bc74efaea6035a2 Jul2021_SP3_release +db3cec8ea853884e857fcfb413428116cb95e786 Jul2021_17 +8c015afafb5903ea59b0e2cffac1138a0d82e007 Jul2021_19 +8c015afafb5903ea59b0e2cffac1138a0d82e007 Jul2021_SP4_release diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,7 +97,7 @@ if(NOT ${CMAKE_INSTALL_PREFIX} STREQUAL # SET(CMAKE_SKIP_RPATH TRUE) endif() -# required for some instalation files +# required for some installation files set(PROGRAM_PERMISSIONS_DEFAULT OWNER_WRITE OWNER_READ diff --git a/clients/ChangeLog.Jan2022 b/clients/ChangeLog.Jan2022 --- a/clients/ChangeLog.Jan2022 +++ b/clients/ChangeLog.Jan2022 @@ -2,9 +2,9 @@ # This file is updated with Maddlog * Wed Feb 16 2022 Sjoerd Mullender <sjo...@acm.org> -- Improved the handling of the \r command in mclient. It now properly - counts the header of table, and when a (very) long table is being - printed and aborted part way in the built-in pager, not all data is - transferred to the client (and then discarded). Instead at most 1000 - rows are transferred. +- Improved the handling of the \r (internal pager) command in mclient. + It now properly counts the header of table, and when a (very) long + table is being printed and aborted part way in the built-in pager, not + all data is transferred to the client (and then discarded). Instead + at most 1000 rows are transferred. 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 @@ -45798,6 +45798,11 @@ similarity command battxtsim.similarity(X_0:bat[:str], X_1:bat[:str]):bat[:dbl] fstrcmp0_impl_bulk; Normalized edit distance between two strings +baturl +extractURLHost +command baturl.extractURLHost(X_0:bat[:str], X_1:bit):bat[:str] +BATextractURLHost; +Extract host from BAT of URLs batuuid isaUUID command batuuid.isaUUID(X_0:bat[:str]):bat[:bit] @@ -64589,6 +64594,11 @@ command txtsim.stringdiff(X_0:str, X_1:s stringdiff_impl; calculate the soundexed editdistance url +extractURLHost +command url.extractURLHost(X_0:str, X_1:bit):str +extractURLHost; +Extract host from a URL relaxed version +url getAnchor command url.getAnchor(X_0:url):str URLgetAnchor; @@ -64622,7 +64632,7 @@ url getHost command url.getHost(X_0:url):str URLgetHost; -Extract the server name from the URL +Extract the server name from the URL strict version url getPort command url.getPort(X_0:url):str diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c --- a/clients/mapiclient/dump.c +++ b/clients/mapiclient/dump.c @@ -3124,8 +3124,8 @@ dump_database(Mapi mid, stream *toConsol if (curschema == NULL || strcmp(schema, curschema) != 0) { if (curschema) free(curschema); - curschema = schema ? strdup(schema) : NULL; - if (schema && !curschema) { + curschema = strdup(schema); + if (curschema == NULL) { free(id); free(schema); free(name); diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c --- a/clients/mapilib/mapi.c +++ b/clients/mapilib/mapi.c @@ -4358,7 +4358,7 @@ read_into_cache(MapiHdl hdl, int lookahe for (;;) { line = read_line(mid); if (line == NULL) { - if (mnstr_eof(mid->from)) { + if (mid->from && mnstr_eof(mid->from)) { mapi_log_record(mid, "unexpected end of file"); mapi_log_record(mid, __func__); close_connection(mid); diff --git a/cmake/monetdb-defines.cmake b/cmake/monetdb-defines.cmake --- a/cmake/monetdb-defines.cmake +++ b/cmake/monetdb-defines.cmake @@ -300,16 +300,18 @@ macro(monetdb_configure_misc) "PASSWORD_BACKEND invalid, choose one of MD5, SHA1, RIPEMD160, SHA224, SHA256, SHA384, SHA512") endif() - # Used for installing testing python module (don't pass a location, else we need to strip this again) - execute_process(COMMAND "${Python3_EXECUTABLE}" "-c" "import sysconfig; print(sysconfig.get_path('purelib', vars={'base': ''})[1:])" - RESULT_VARIABLE PY3_LIBDIR_CODE - OUTPUT_VARIABLE PYTHON3_SITEDIR - OUTPUT_STRIP_TRAILING_WHITESPACE) - if (PY3_LIBDIR_CODE) - message(WARNING - "Could not determine MonetDB Python3 site-packages instalation directory") + if(NOT DEFINED PYTHON3_LIBDIR) + # Used for installing testing python module (don't pass a location, else we need to strip this again) + execute_process(COMMAND "${Python3_EXECUTABLE}" "-c" "import sysconfig; print(sysconfig.get_path('purelib', vars={'base': ''})[1:])" + RESULT_VARIABLE PY3_LIBDIR_CODE + OUTPUT_VARIABLE PYTHON3_SITEDIR + OUTPUT_STRIP_TRAILING_WHITESPACE) + if (PY3_LIBDIR_CODE) + message(WARNING + "Could not determine MonetDB Python3 site-packages installation directory") + endif() + set(PYTHON3_LIBDIR "${PYTHON3_SITEDIR}") endif() - set(PYTHON3_LIBDIR "${PYTHON3_SITEDIR}") set(PYTHON "${Python3_EXECUTABLE}") if(MSVC) diff --git a/cmake/monetdb-packages.cmake b/cmake/monetdb-packages.cmake --- a/cmake/monetdb-packages.cmake +++ b/cmake/monetdb-packages.cmake @@ -23,7 +23,7 @@ include(monetdb-wix-packages) if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") get_os_release_info(LINUX_DISTRO LINUX_DISTRO_VERSION) - if (${LINUX_DISTRO} STREQUAL "debian") + if ("${LINUX_DISTRO}" STREQUAL "debian") monetdb_debian_extra_files() endif() endif() diff --git a/common/stream/xz_stream.c b/common/stream/xz_stream.c --- a/common/stream/xz_stream.c +++ b/common/stream/xz_stream.c @@ -161,9 +161,9 @@ xz_stream(stream *inner, int preset) ret = lzma_easy_encoder(&xz->strm, preset, LZMA_CHECK_CRC64); } - stream *s = pump_stream(inner, state); + stream *s; - if (ret != LZMA_OK || s == NULL) { + if (ret != LZMA_OK || (s = pump_stream(inner, state)) == NULL) { lzma_end(&xz->strm); free(xz); free(state); diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c --- a/common/utils/msabaoth.c +++ b/common/utils/msabaoth.c @@ -612,14 +612,26 @@ msab_pickSecret(char **generated_secret) } } #else - (void)bin_secret; - if (generated_secret) - // do not return an error, just continue without a secret - *generated_secret = NULL; - free(secret); - return NULL; + int rfd = open("/dev/urandom", O_RDONLY); + if (rfd >= 0) { + ssize_t nr; + for (size_t n = 0; n < sizeof(bin_secret); n += nr) { + nr = read(rfd, bin_secret + n, sizeof(bin_secret) - n); + if (nr < 0) { + free(secret); + return strdup("reading /dev/urandom failed"); + } + } + close(rfd); + } else { + (void)bin_secret; + if (generated_secret) + // do not return an error, just continue without a secret + *generated_secret = NULL; + free(secret); + return NULL; + } #endif -#if defined(HAVE_GETENTROPY) || defined(HAVE_RAND_S) int fd; FILE *f; for (size_t i = 0; i < sizeof(bin_secret); i++) { @@ -659,7 +671,6 @@ msab_pickSecret(char **generated_secret) else free(secret); return NULL; -#endif } /** diff --git a/debian/rules b/debian/rules --- a/debian/rules +++ b/debian/rules @@ -13,6 +13,7 @@ DH_VERBOSE=1 override_dh_auto_configure: dh_auto_configure -- \ + -DPYTHON3_LIBDIR=lib/python3/dist-packages -DCMAKE_INSTALL_RUNSTATEDIR=/run \ -DRELEASE_VERSION=ON \ -DASSERT=OFF \ diff --git a/documentation/source/developers_handbook.rst b/documentation/source/developers_handbook.rst --- a/documentation/source/developers_handbook.rst +++ b/documentation/source/developers_handbook.rst @@ -120,7 +120,7 @@ Consider the following single client con Alternatively existing ``.sql`` scripts can be converted to sqllogic tests (.test) with ``Mconvert.py``. For example:: - $Mconvert.py --auto <module>/Tests <convert_me>.sql + $ Mconvert.py --auto <module>/Tests <convert_me>.sql All new tests need to be placed in the appropriate test folder and their name respectively in the index ``All`` file. diff --git a/gdk/ChangeLog.Jan2022 b/gdk/ChangeLog.Jan2022 --- a/gdk/ChangeLog.Jan2022 +++ b/gdk/ChangeLog.Jan2022 @@ -1,3 +1,11 @@ # ChangeLog file for GDK # This file is updated with Maddlog +* Wed Mar 9 2022 Sjoerd Mullender <sjo...@acm.org> +- Fixed a bug in the append code for msk (bit mask) bats. +- Conversions from floating point types to integral types that involve + multiplication now use the "long double" as intermediate type, thereby + loosing as few significant bits as is feasible. +- Found and fixed another source for the now infamous BBPcheckbats error + that sometimes occurs at startup of the server. + diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -775,6 +775,8 @@ typedef struct BAT { batTransient:1; /* should the BAT persist on disk? */ uint8_t /* adjacent bit fields are packed together (if they fit) */ batRestricted:2; /* access privileges */ + uint16_t /* adjacent bit fields are packed together (if they fit) */ + selcnt:10; /* how often used in equi select without hash */ role_t batRole; /* role of the bat */ uint16_t unused; /* value=0 for now (sneakily used by mat.c) */ int batSharecnt; /* incoming view count */ diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c --- a/gdk/gdk_batop.c +++ b/gdk/gdk_batop.c @@ -1391,14 +1391,23 @@ BATappend_or_update(BAT *b, BAT *p, cons else if (pos <= bi.minpos && bi.minpos < pos + ni.count) bi.minpos = BUN_NONE; } + if (complex_cand(n)) { + for (BUN i = 0, j = ni.count; i < j; i++) + o[i] = *(oid *)Tpos(&ni, i); + /* last value */ + v = o[ni.count - 1]; + } else { + for (BUN i = 0, j = ni.count; i < j; i++) + o[i] = v++; + /* last value added (not one beyond) */ + v--; + } if (bi.maxpos != BUN_NONE) { - if (v + ni.count - 1 >= BUNtoid(b, bi.maxpos)) + if (v >= BUNtoid(b, bi.maxpos)) bi.maxpos = pos + ni.count - 1; else if (pos <= bi.maxpos && bi.maxpos < pos + ni.count) bi.maxpos = BUN_NONE; } - for (BUN i = 0, j = ni.count; i < j; i++) - o[i] = v++; } } else { /* if the extremes of n are at least as diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -1896,6 +1896,7 @@ new_bbpentry(FILE *fp, bat i, BUN size) } #endif + assert(size <= BBP_desc(i)->batCount || size == BUN_NONE); if (size > BBP_desc(i)->batCount) size = BBP_desc(i)->batCount; if (fprintf(fp, "%d %u %s %s %d " BUNFMT " " BUNFMT " " OIDFMT, @@ -3927,6 +3928,7 @@ BBPsync(int cnt, bat *restrict subcommit if (lock) MT_lock_unset(&GDKswapLock(i)); _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org