Changeset: f08379282e72 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f08379282e72 Branch: octbugs Log Message:
Merged with Oct2020 diffs (truncated from 511 to 300 lines): diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -147,6 +147,18 @@ BuildRequires: python3-numpy %if %{with rintegration} BuildRequires: pkgconfig(libR) %endif +# if we were to compile with cmocka support (-DWITH_CMOCKA=ON): +# BuildRequires: pkgconfig(cmocka) +# if we were to compile with lz4 support (-DWITH_LZ4=ON): +# BuildRequires: pkgconfig(liblz4) +# if we were to compile with NetCDF support (-DNETCDF=ON): +# BuildRequires: pkgconfig(netcdf) +# if we were to compile with proj support (-DWITH_PROJ=ON): +# BuildRequires: pkgconfig(proj) +# if we were to compile with snappy support (-DWITH_SNAPPY=ON): +# BuildRequires: pkgconfig(snappy) +# if we were to compile with valgrind support (-DWITH_VALGRIND=ON): +# BuildRequires: pkgconfig(valgrind) %if (0%{?fedora} >= 22) Recommends: %{name}-SQL-server5%{?_isa} = %{version}-%{release} @@ -770,6 +782,8 @@ export CFLAGS %endif %cmake3 \ -DRELEASE_VERSION=ON \ + -DRUNDIR=%{_rundir}/monetdb \ + -DLOGDIR=%{_localstatedir}/log/monetdb \ -DASSERT=OFF \ -DCINTEGRATION=%{?with_cintegration:ON}%{!?with_cintegration:OFF} \ -DFITS=%{?with_fits:ON}%{!?with_fits:OFF} \ @@ -936,7 +950,7 @@ fi Instead do SET current_timezone = interval '1' hour; Casting between interval and other numeric types is no longer possible as well, because they are not compatible. -- sql: Because of incompatibilities this change may create, if an user intents +- sql: Because of incompatibilities this change may create, if a user intends to convert a numeric value to an interval, the multiplication function can be used in the form: <numeric value> * interval '1' <interval length> e.g. 10 * interval '1' second = interval '10' second. @@ -944,7 +958,7 @@ fi syntax. This option returns the number of milliseconds since the UNIX epoch 1970-01-01 00:00:00 UTC for date, timestamp and time values (it can be negative). Meanwhile, for day and second intervals, it returns the - total number of milliseconds on the interval. As a side note, the 'EPOCH' + total number of milliseconds in the interval. As a side note, the 'EPOCH' option is not available for month intervals, because this conversion is not transparent for this type. diff --git a/buildtools/conf/monetdbd.conf b/buildtools/conf/monetdbd.conf.in rename from buildtools/conf/monetdbd.conf rename to buildtools/conf/monetdbd.conf.in --- a/buildtools/conf/monetdbd.conf +++ b/buildtools/conf/monetdbd.conf.in @@ -1,3 +1,3 @@ # this file is for systemd # monetdbd needs a directory in /run that is owned by monetdb:monetdb -d /run/monetdb 0775 monetdb monetdb - +d @RUNDIR@/monetdb 0775 monetdb monetdb - diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -828,16 +828,15 @@ XMLrenderer(MapiHdl hdl) /* we must use toConsole since the XML file is encoded in UTF-8 */ mnstr_flush(toConsole, MNSTR_FLUSH_DATA); - mnstr_printf(toConsole, "<?xml version='1.0' encoding='UTF-8'?>\n"); - mnstr_printf(toConsole, - "<!DOCTYPE table [\n" - " <!ELEMENT table (row)*>\n" /* a table consists of zero or more rows */ - " <!ELEMENT row (column)+>\n" /* a row consists of one or more columns */ - " <!ELEMENT column (#PCDATA)>\n" - " <!ATTLIST table name CDATA #IMPLIED>\n" /* a table may have a name */ - " <!ATTLIST column name CDATA #IMPLIED\n" /* a column may have a name */ - " isnull (true|false) 'false'>]>\n"); - mnstr_printf(toConsole, "<table"); + mnstr_printf(toConsole, "<?xml version='1.0' encoding='UTF-8'?>\n" + "<!DOCTYPE table [\n" + " <!ELEMENT table (row)*>\n" /* a table consists of zero or more rows */ + " <!ELEMENT row (column)+>\n" /* a row consists of one or more columns */ + " <!ELEMENT column (#PCDATA)>\n" + " <!ATTLIST table name CDATA #IMPLIED>\n" /* a table may have a name */ + " <!ATTLIST column name CDATA #IMPLIED\n" /* a column may have a name */ + " isnull (true|false) 'false'>]>\n" + "<table"); name = mapi_get_table(hdl, 0); if (name != NULL && *name != 0) XMLprattr("name", name); @@ -2109,8 +2108,8 @@ showCommands(void) mnstr_printf(toConsole, "\\? - show this message\n"); if (mode == MAL) mnstr_printf(toConsole, "?pat - MAL function help. pat=[modnme[.fcnnme][(][)]] wildcard *\n"); - mnstr_printf(toConsole, "\\<file - read input from file\n"); - mnstr_printf(toConsole, "\\>file - save response in file, or stdout if no file is given\n"); + mnstr_printf(toConsole, "\\<file - read input from file\n" + "\\>file - save response in file, or stdout if no file is given\n"); #ifdef HAVE_POPEN mnstr_printf(toConsole, "\\|cmd - pipe result to process, or stop when no command is given\n"); #endif @@ -2118,20 +2117,20 @@ showCommands(void) mnstr_printf(toConsole, "\\history - show the readline history\n"); #endif if (mode == SQL) { - mnstr_printf(toConsole, "\\help - synopsis of the SQL syntax\n"); - mnstr_printf(toConsole, "\\D table - dumps the table, or the complete database if none given.\n"); - mnstr_printf(toConsole, "\\d[Stvsfn]+ [obj] - list database objects, or describe if obj given\n"); - mnstr_printf(toConsole, "\\A - enable auto commit\n"); - mnstr_printf(toConsole, "\\a - disable auto commit\n"); + mnstr_printf(toConsole, "\\help - synopsis of the SQL syntax\n" + "\\D table - dumps the table, or the complete database if none given.\n" + "\\d[Stvsfn]+ [obj] - list database objects, or describe if obj given\n" + "\\A - enable auto commit\n" + "\\a - disable auto commit\n"); } - mnstr_printf(toConsole, "\\e - echo the query in sql formatting mode\n"); - mnstr_printf(toConsole, "\\t - set the timer {none,clock,performance} (none is default)\n"); - mnstr_printf(toConsole, "\\f - format using renderer {csv,tab,raw,sql,xml,trash,rowcount,expanded}\n"); - mnstr_printf(toConsole, "\\w# - set maximal page width (-1=unlimited, 0=terminal width, >0=limit to num)\n"); - mnstr_printf(toConsole, "\\r# - set maximum rows per page (-1=raw)\n"); - mnstr_printf(toConsole, "\\L file - save client-server interaction\n"); - mnstr_printf(toConsole, "\\X - trace mclient code\n"); - mnstr_printf(toConsole, "\\q - terminate session and quit mclient\n"); + mnstr_printf(toConsole, "\\e - echo the query in sql formatting mode\n" + "\\t - set the timer {none,clock,performance} (none is default)\n" + "\\f - format using renderer {csv,tab,raw,sql,xml,trash,rowcount,expanded}\n" + "\\w# - set maximal page width (-1=unlimited, 0=terminal width, >0=limit to num)\n" + "\\r# - set maximum rows per page (-1=raw)\n" + "\\L file - save client-server interaction\n" + "\\X - trace mclient code\n" + "\\q - terminate session and quit mclient\n"); } #define MD_TABLE 1 @@ -3591,10 +3590,9 @@ main(int argc, char **argv) if (mode == SQL) dump_version(mid, toConsole, "Database:"); - mnstr_printf(toConsole, "FOLLOW US on https://twitter.com/MonetDB "); - mnstr_printf(toConsole, "or https://github.com/MonetDB/MonetDB\n"); - - mnstr_printf(toConsole, "Type \\q to quit, \\? for a list of available commands\n"); + mnstr_printf(toConsole, "FOLLOW US on https://twitter.com/MonetDB " + "or https://github.com/MonetDB/MonetDB\n" + "Type \\q to quit, \\? for a list of available commands\n"); if (mode == SQL) mnstr_printf(toConsole, "auto commit mode: %s\n", mapi_get_autocommit(mid) ? "on" : "off"); diff --git a/ctest/tools/monetdbe/test_helper_template.h b/ctest/tools/monetdbe/test_helper_template.h --- a/ctest/tools/monetdbe/test_helper_template.h +++ b/ctest/tools/monetdbe/test_helper_template.h @@ -47,7 +47,7 @@ bool CHECK_COLUMN_FUNC ( } for (size_t i = 0; i < expected_nr_column_entries; i++) { - if (! ((col_x->is_null(col_x->data[i]) && expected_column[i]._is_null) || EQUALS(col_x->data[i], expected_column[i].data))) { + if (! ((col_x->is_null(&col_x->data[i]) && expected_column[i]._is_null) || EQUALS(col_x->data[i], expected_column[i].data))) { printf("Mismatch between expected and actual column values: values differ at index %ld\n", i); return false; } diff --git a/debian/changelog b/debian/changelog --- a/debian/changelog +++ b/debian/changelog @@ -103,7 +103,7 @@ monetdb (11.39.1) unstable; urgency=low Instead do SET current_timezone = interval '1' hour; Casting between interval and other numeric types is no longer possible as well, because they are not compatible. - * sql: Because of incompatibilities this change may create, if an user intents + * sql: Because of incompatibilities this change may create, if a user intends to convert a numeric value to an interval, the multiplication function can be used in the form: <numeric value> * interval '1' <interval length> e.g. 10 * interval '1' second = interval '10' second. @@ -111,7 +111,7 @@ monetdb (11.39.1) unstable; urgency=low syntax. This option returns the number of milliseconds since the UNIX epoch 1970-01-01 00:00:00 UTC for date, timestamp and time values (it can be negative). Meanwhile, for day and second intervals, it returns the - total number of milliseconds on the interval. As a side note, the 'EPOCH' + total number of milliseconds in the interval. As a side note, the 'EPOCH' option is not available for month intervals, because this conversion is not transparent for this type. diff --git a/debian/rules b/debian/rules --- a/debian/rules +++ b/debian/rules @@ -14,6 +14,8 @@ DH_VERBOSE=1 override_dh_auto_configure: dh_auto_configure -- \ -DRELEASE_VERSION=ON \ + -DRUNDIR=/run/monetdb \ + -DLOGDIR=/var/log/monetdb \ -DASSERT=OFF \ -DCINTEGRATION=ON \ -DFITS=ON \ diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h --- a/gdk/gdk_private.h +++ b/gdk/gdk_private.h @@ -168,6 +168,8 @@ gdk_return GDKssort_rev(void *restrict h gdk_return GDKssort(void *restrict h, void *restrict t, const void *restrict base, size_t n, int hs, int ts, int tpe) __attribute__((__warn_unused_result__)) __attribute__((__visibility__("hidden"))); +void GDKtracer_init(void) + __attribute__((__visibility__("hidden"))); gdk_return GDKunlink(int farmid, const char *dir, const char *nme, const char *extension) __attribute__((__visibility__("hidden"))); void HASHfree(BAT *b) diff --git a/gdk/gdk_tracer.c b/gdk/gdk_tracer.c --- a/gdk/gdk_tracer.c +++ b/gdk/gdk_tracer.c @@ -9,6 +9,7 @@ #include "monetdb_config.h" #include "gdk.h" #include "gdk_tracer.h" +#include "gdk_private.h" #define DEFAULT_ADAPTER BASIC #define DEFAULT_LOG_LEVEL M_ERROR @@ -143,6 +144,13 @@ set_level_for_layer(int layer, int lvl) const char *tok = NULL; log_level_t level = (log_level_t) lvl; + // make sure we initialize before changing the component level + MT_lock_set(&lock); + if (file_name[0] == 0) { + _GDKtracer_init_basic_adptr(); + } + MT_lock_unset(&lock); + for (int i = 0; i < COMPONENTS_COUNT; i++) { if (layer == MDB_ALL) { lvl_per_component[i] = level; @@ -286,6 +294,13 @@ GDKtracer_set_component_level(const char return GDK_FAIL; } + // make sure we initialize before changing the component level + MT_lock_set(&lock); + if (file_name[0] == 0) { + _GDKtracer_init_basic_adptr(); + } + MT_lock_unset(&lock); + lvl_per_component[component] = level; return GDK_SUCCEED; @@ -400,6 +415,17 @@ GDKtracer_reset_adapter(void) return GDK_SUCCEED; } +static bool add_ts; /* add timestamp to error message to stderr */ + +void +GDKtracer_init(void) +{ +#ifdef _MSC_VER + add_ts = GetFileType(GetStdHandle(STD_ERROR_HANDLE)) != FILE_TYPE_PIPE; +#else + add_ts = isatty(2) || lseek(2, 0, SEEK_CUR) != (off_t) -1 || errno != ESPIPE; +#endif +} void GDKtracer_log(const char *file, const char *func, int lineno, @@ -475,7 +501,9 @@ GDKtracer_log(const char *file, const ch } if (level == M_CRITICAL || level == M_ERROR || level == M_WARNING) { - fprintf(stderr, "#%s: %s: %s%s%s%s\n", + fprintf(stderr, "#%s%s%s: %s: %s%s%s%s\n", + add_ts ? ts : "", + add_ts ? ": " : "", MT_thread_getname(), func, GDKERROR, msg, syserr ? ": " : "", syserr ? syserr : ""); @@ -484,7 +512,8 @@ GDKtracer_log(const char *file, const ch } MT_lock_set(&lock); if (file_name[0] == 0) { - _GDKtracer_init_basic_adptr(); + MT_lock_unset(&lock); + return; } MT_lock_unset(&lock); if (syserr) diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c --- a/gdk/gdk_utils.c +++ b/gdk/gdk_utils.c @@ -807,6 +807,7 @@ GDKinit(opt *set, int setlen, bool embed /* BBP was locked by BBPexit() */ BBPunlock(); } + GDKtracer_init(); errno = 0; if (!GDKinmemory() && !GDKenvironment(dbpath)) return GDK_FAIL; diff --git a/misc/packages/deb/changelog b/misc/packages/deb/changelog --- a/misc/packages/deb/changelog +++ b/misc/packages/deb/changelog @@ -103,7 +103,7 @@ monetdb (11.39.1) unstable; urgency=low Instead do SET current_timezone = interval '1' hour; Casting between interval and other numeric types is no longer possible as well, because they are not compatible. _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list