Changeset: 274eb9789490 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=274eb9789490 Modified Files: clients/mapiclient/mclient.1 gdk/gdk_bat.c gdk/gdk_tracer.c monetdb5/mal/mal.c monetdb5/mal/mal_parser.c monetdb5/tools/Tests/mserver5--help.stable.err monetdb5/tools/Tests/mserver5--help.stable.err.Windows tools/merovingian/client/monetdb.1 tools/merovingian/daemon/monetdbd.1.in tools/mserver/mserver5.1.in tools/mserver/mserver5.c Branch: default Log Message:
Merge with Jun2020 branch. diffs (281 lines): diff --git a/clients/mapiclient/mclient.1 b/clients/mapiclient/mclient.1 --- a/clients/mapiclient/mclient.1 +++ b/clients/mapiclient/mclient.1 @@ -169,8 +169,12 @@ All timings are reported on stderr. .br \fBNote\fP that the client-measured wall-clock time is reported per query \fBonly\fP when options \fB\-\-interactive\fP or \fB\-\-echo\fP are used, -because only then does mclient send individual lines (statements) of the SQL -script to the server. Otherwise, when mclient sends the SQL script in +because only then does +.I mclient +send individual lines (statements) of the SQL +script to the server. Otherwise, when +.I mclient +sends the SQL script in large(r) batch(es), only the total wall-clock time per batch is measured and reported. The server-measured detailed performance timings are always measured and reported per query. @@ -454,7 +458,9 @@ is the name of the database. mclient \-d $db \-s \(dqCOPY INTO $table FROM '$file' USING DELIMITERS ',',E'\e\en','\e\(dq'\(dq .PP Efficiently import data from a CSV file into a table when the file is -to be read by mclient (e.g. the server has no access to the file). +to be read by +.I mclient +(e.g. the server has no access to the file). .I $file is the (absolute or relative) path name of the file, .I $table diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c --- a/gdk/gdk_bat.c +++ b/gdk/gdk_bat.c @@ -2363,13 +2363,16 @@ BATassertProps(BAT *b) BUN mask; if ((hs = GDKzalloc(sizeof(Hash))) == NULL) { - TRC_ERROR(BAT_, "Cannot allocate hash table\n"); + TRC_WARNING(BAT_, "Cannot allocate hash table\n"); goto abort_check; } if (snprintf(hs->heaplink.filename, sizeof(hs->heaplink.filename), "%s.thshprpl%x", nme, (unsigned) THRgettid()) >= (int) sizeof(hs->heaplink.filename) || snprintf(hs->heapbckt.filename, sizeof(hs->heapbckt.filename), "%s.thshprpb%x", nme, (unsigned) THRgettid()) >= (int) sizeof(hs->heapbckt.filename)) { + /* cannot happen, see comment in gdk.h + * about sizes near definition of + * BBPINIT */ GDKfree(hs); - TRC_ERROR(BAT_, "Heap filename is too large\n"); + TRC_CRITICAL(BAT_, "Heap filename is too large\n"); goto abort_check; } if (ATOMsize(b->ttype) == 1) @@ -2385,7 +2388,7 @@ BATassertProps(BAT *b) HASHnew(hs, b->ttype, BUNlast(b), mask, BUN_NONE, false) != GDK_SUCCEED) { GDKfree(hs); - TRC_ERROR(BAT_, "Cannot allocate hash table\n"); + TRC_WARNING(BAT_, "Cannot allocate hash table\n"); goto abort_check; } BATloop(b, p, q) { diff --git a/gdk/gdk_tracer.c b/gdk/gdk_tracer.c --- a/gdk/gdk_tracer.c +++ b/gdk/gdk_tracer.c @@ -104,14 +104,24 @@ static gdk_return const char *trace_path; trace_path = GDKgetenv("gdk_dbtrace"); - if (trace_path == NULL) + if (trace_path == NULL) { trace_path = GDKgetenv("gdk_dbpath"); - if (trace_path == NULL) { - active_tracer = stderr; - return GDK_SUCCEED; + if (trace_path == NULL) { + active_tracer = stderr; + return GDK_SUCCEED; + } + if (strconcat_len(file_name, sizeof(file_name), + trace_path, DIR_SEP_STR, FILE_NAME, NULL) + >= sizeof(file_name)) { + goto too_long; + } + } else { + if (strcpy_len(file_name, trace_path, sizeof(file_name)) + >= sizeof(file_name)) { + goto too_long; + } } - snprintf(file_name, sizeof(file_name), "%s%c%s", trace_path, DIR_SEP, FILE_NAME); active_tracer = fopen(file_name, "a"); if (active_tracer == NULL) { @@ -122,6 +132,12 @@ static gdk_return } return GDK_SUCCEED; + + too_long: + GDK_TRACER_EXCEPTION("path name for dbtrace file too long"); + file_name[0] = 0; /* uninitialize */ + active_tracer = stderr; + return GDK_FAIL; } diff --git a/monetdb5/mal/mal.c b/monetdb5/mal/mal.c --- a/monetdb5/mal/mal.c +++ b/monetdb5/mal/mal.c @@ -70,7 +70,7 @@ int mal_init(void){ #ifndef NDEBUG mdbExit(); #endif - TRC_ERROR(MAL_SERVER, "%s\n", err); + TRC_CRITICAL(MAL_SERVER, "%s\n", err); freeException(err); return -1; } diff --git a/monetdb5/mal/mal_parser.c b/monetdb5/mal/mal_parser.c --- a/monetdb5/mal/mal_parser.c +++ b/monetdb5/mal/mal_parser.c @@ -1051,12 +1051,12 @@ parseInclude(Client cntxt) s = loadLibrary(modnme, FALSE); if (s) { parseError(cntxt, s); - GDKfree(s); + freeException(s); return 0; } if ((s = malInclude(cntxt, modnme, 0))) { parseError(cntxt, s); - GDKfree(s); + freeException(s); return 0; } return 0; diff --git a/monetdb5/tools/Tests/mserver5--help.stable.err b/monetdb5/tools/Tests/mserver5--help.stable.err --- a/monetdb5/tools/Tests/mserver5--help.stable.err +++ b/monetdb5/tools/Tests/mserver5--help.stable.err @@ -13,7 +13,7 @@ stderr of test 'mserver5--help` in direc Usage: mserver5 [options] --dbpath=<directory> Specify database location --dbextra=<directory> Directory for transient BATs - --dbtrace=<directory> Directory for produced traces + --dbtrace=<file> File for produced traces --in-memory Run database in-memory only --config=<config_file> Use config_file to read options from --single-user Allow only one user at a time diff --git a/monetdb5/tools/Tests/mserver5--help.stable.err.Windows b/monetdb5/tools/Tests/mserver5--help.stable.err.Windows --- a/monetdb5/tools/Tests/mserver5--help.stable.err.Windows +++ b/monetdb5/tools/Tests/mserver5--help.stable.err.Windows @@ -8,7 +8,7 @@ stderr of test 'mserver5--help` in direc Usage: mserver5.exe [options] --dbpath=<directory> Specify database location --dbextra=<directory> Directory for transient BATs - --dbtrace=<directory> Directory for produced traces + --dbtrace=<file> File for produced traces --in-memory Run database in-memory only --config=<config_file> Use config_file to read options from --single-user Allow only one user at a time diff --git a/tools/merovingian/client/monetdb.1 b/tools/merovingian/client/monetdb.1 --- a/tools/merovingian/client/monetdb.1 +++ b/tools/merovingian/client/monetdb.1 @@ -369,10 +369,14 @@ allow to be controlled remotely can be f with an asterisk. These entries can easily be filtered out using an expression (e.g. "mapi:monetdb:*") if desired. The control entries come in handy when one wants to get an overview of available monetdbds in -e.g. a local cluster. Note that for monetdbd to announce its control +e.g. a local cluster. Note that for +.I monetdbd +to announce its control port, the .I mero_controlport -setting for that monetdbd must be enabled in the configuration file. +setting for that +.I monetdbd +must be enabled in the configuration file. .TP .B \-h .PD 0 diff --git a/tools/merovingian/daemon/monetdbd.1.in b/tools/merovingian/daemon/monetdbd.1.in --- a/tools/merovingian/daemon/monetdbd.1.in +++ b/tools/merovingian/daemon/monetdbd.1.in @@ -170,7 +170,9 @@ This property specifies which TCP port should listen to for connection requests. Defaults to 50000. .TP .B ipv6 -This property forces monetdbd to bind connections on IPv6 addresses only. +This property forces +.I monetdbd +to bind connections on IPv6 addresses only. Defaults to false. .TP .B listenaddr diff --git a/tools/mserver/mserver5.1.in b/tools/mserver/mserver5.1.in --- a/tools/mserver/mserver5.1.in +++ b/tools/mserver/mserver5.1.in @@ -63,11 +63,23 @@ Default value: .BR @localstatedir@/monetdb5/dbfarm/demo . .TP \fB\-\-dbextra=\fP\fIpath\fP -Path where mserver5 should store transient data. Default value is the +Path where +.I mserver5 +should store transient data. Default value is the value of the .B \-\-dbpath option. .TP +\fB\-\-dbtrace=\fP\fIpath\fP +File name for the trace log file for +.IR mserver5 . +Default value is the +file +.B mdbtrace.log +inside the directory specified with the +.B \-\-dbpath +option. +.TP \fB\-\-config=\fP\fIfile\fP Config file to read options from. This file can contain all options as can be set with the --set flag. @@ -87,7 +99,9 @@ Print list of options. Print version and compile configuration. .TP .B \-\-in\-memory -Run mserver5 in-memory. +Run +.I mserver5 +in-memory. .B No data will be persisted. .TP diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c --- a/tools/mserver/mserver5.c +++ b/tools/mserver/mserver5.c @@ -89,7 +89,7 @@ usage(char *prog, int xit) fprintf(stderr, "Usage: %s [options]\n", prog); fprintf(stderr, " --dbpath=<directory> Specify database location\n"); fprintf(stderr, " --dbextra=<directory> Directory for transient BATs\n"); - fprintf(stderr, " --dbtrace=<directory> Directory for produced traces\n"); + fprintf(stderr, " --dbtrace=<file> File for produced traces\n"); fprintf(stderr, " --in-memory Run database in-memory only\n"); fprintf(stderr, " --config=<config_file> Use config_file to read options from\n"); fprintf(stderr, " --single-user Allow only one user at a time\n"); @@ -259,7 +259,6 @@ handler(int sig) int main(int argc, char **av) { - DIR *dirp; char *prog = *av; opt *set = NULL; int grpdebug = 0, debug = 0, setlen = 0; @@ -275,7 +274,7 @@ main(int argc, char **av) { "config", required_argument, NULL, 'c' }, { "dbpath", required_argument, NULL, 0 }, { "dbextra", required_argument, NULL, 0 }, - { "dbtrace", optional_argument, NULL, 0 }, + { "dbtrace", required_argument, NULL, 0 }, { "debug", optional_argument, NULL, 'd' }, { "help", no_argument, NULL, '?' }, { "version", no_argument, NULL, 0 }, @@ -519,18 +518,6 @@ main(int argc, char **av) fprintf(stderr, "!ERROR: cannot create directory for %s\n", dbtrace); exit(1); } - /* create the actual dir for db-trace */ - if (mkdir(dbtrace, MONETDB_DIRMODE) < 0) { - if (errno != EEXIST) { - fprintf(stderr, "!ERROR: cannot create directory for %s\n", dbtrace); - exit(1); - } - if ((dirp = opendir(dbtrace)) == NULL) { - fprintf(stderr, "!ERROR: cannot create directory for %s\n", dbtrace); - exit(1); - } - closedir(dirp); - } GDKfree(dbtrace); } _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list