Changeset: a84ca4644f52 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a84ca4644f52
Modified Files:
        NT/monetdb_config.h.in
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        clients/Tests/exports.stable.out
        clients/mapiclient/dump.c
        clients/mapiclient/mhelp.c
        clients/mapiclient/msqldump.c
        common/utils/mutils.c
        gdk/gdk_analytic_bounds.c
        gdk/gdk_analytic_func.c
        gdk/gdk_posix.c
        gdk/gdk_private.h
        gdk/gdk_system.c
        gdk/gdk_system.h
        gdk/gdk_utils.c
        geom/monetdb5/geom.c
        geom/monetdb5/geom_upgrade.c
        monetdb5/mal/mal_builder.c
        monetdb5/mal/mal_builder.h
        monetdb5/mal/mal_client.c
        monetdb5/mal/mal_client.h
        monetdb5/mal/mal_instruction.c
        monetdb5/mal/mal_instruction.h
        monetdb5/mal/mal_interpreter.c
        monetdb5/mal/mal_module.c
        monetdb5/mal/mal_profiler.c
        monetdb5/mal/mal_runtime.c
        monetdb5/modules/atoms/mtime.c
        monetdb5/modules/atoms/mtime_analytic.c
        monetdb5/modules/mal/Tests/inspect05.stable.out.int128
        monetdb5/modules/mal/Tests/mat.malC
        monetdb5/modules/mal/Tests/mat.stable.out
        monetdb5/modules/mal/clients.c
        monetdb5/modules/mal/clients.h
        monetdb5/modules/mal/clients.mal
        monetdb5/modules/mal/manual.c
        monetdb5/modules/mal/mat.c
        monetdb5/modules/mal/mat.mal
        monetdb5/modules/mal/profiler.c
        monetdb5/modules/mal/profiler.mal
        monetdb5/modules/mal/tokenizer.c
        monetdb5/optimizer/opt_pipes.c
        sql/backends/monet5/UDF/udf/Tests/udf-fuse.stable.out
        sql/backends/monet5/UDF/udf/Tests/udf-reverse.stable.out
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql.mal
        sql/backends/monet5/sql_cat.c
        sql/backends/monet5/sql_gencode.c
        sql/backends/monet5/sql_optimizer.c
        sql/backends/monet5/sql_scenario.c
        sql/backends/monet5/sql_statement.c
        sql/backends/monet5/sql_upgrades.c
        sql/backends/monet5/sql_upgrades.h
        sql/backends/monet5/vaults/fits/fits.c
        sql/backends/monet5/vaults/shp/shp.c
        sql/scripts/22_clients.sql
        sql/scripts/26_sysmon.sql
        sql/scripts/99_system.sql
        sql/server/rel_exp.c
        sql/server/rel_optimizer.c
        sql/server/rel_psm.c
        sql/server/rel_rel.c
        sql/server/rel_schema.c
        sql/server/rel_updates.c
        sql/server/sql_parser.y
        sql/server/sql_scan.c
        sql/storage/store.c
        sql/test/BugConstraints/Tests/check_constraint.SF-1714829.stable.err
        
sql/test/BugDay_2005-12-19_2.9.3/Tests/default_next_value_for_non_ex_seq.SF.1246631.stable.err
        
sql/test/BugTracker-2009/Tests/segfault_when_quitting_debugger.SF-2538837.stable.out
        
sql/test/BugTracker-2010/Tests/LIMIT_OFFSET_big-endian.Bug-2622.stable.out
        sql/test/BugTracker-2012/Tests/create_function.Bug-3172.sql
        sql/test/BugTracker-2012/Tests/create_function.Bug-3172.stable.err
        sql/test/BugTracker-2012/Tests/create_function.Bug-3172.stable.out
        
sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.stable.out
        
sql/test/BugTracker-2012/Tests/table_function_with_column_subselects.Bug-3172.sql
        
sql/test/BugTracker-2012/Tests/table_function_with_column_subselects.Bug-3172.stable.err
        sql/test/BugTracker-2013/Tests/pivot.Bug-3339.stable.err
        sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.err
        sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.out
        sql/test/BugTracker-2014/Tests/manifold.Bug-3556.stable.out
        
sql/test/BugTracker-2016/Tests/CREATE_INDEX_breaks_table_queries.Bug-4053.stable.out
        sql/test/BugTracker-2017/Tests/side-effect.Bug-6397.stable.out
        
sql/test/BugTracker-2019/Tests/disallow_duplicate_column_aliases.Bug-6723.stable.out
        
sql/test/BugTracker-2019/Tests/duplicates-not-eliminated-long-CASE-stmt.Bug-6697.stable.out
        sql/test/BugTracker-2019/Tests/prepare-types.Bug-6724.stable.out
        sql/test/BugTracker/Tests/bug_in_selection.SF-1892413.stable.err
        sql/test/BugTracker/Tests/bug_in_selection.SF-1892413.stable.out
        
sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-0join-query.stable.out
        
sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-0join-view.stable.out
        
sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-1join-query.stable.out
        
sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-1join-view.stable.out
        
sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-2join-query.stable.out
        
sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-2join-view.stable.out
        sql/test/Tests/comment-dump.stable.out
        sql/test/Tests/keys.sql
        sql/test/Tests/keys.stable.out
        sql/test/Triggers/Tests/trigger_owner.stable.err
        sql/test/copy/Tests/nonutf8.stable.err
        sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
        
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.int128
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
        sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade/Tests/upgrade.stable.out
        sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
        sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
        sql/test/emptydb/Tests/check.stable.out.32bit
        sql/test/miscellaneous/Tests/All
        sql/test/pg_regress/Tests/alter_table.stable.err
        sql/test/pg_regress/Tests/alter_table.stable.out
        sql/test/remote/Tests/partition_elim.stable.out
        sql/test/subquery/Tests/correlated.stable.err
        sql/test/sys-schema/Tests/systemfunctions.stable.out
        sql/test/sys-schema/Tests/systemfunctions.stable.out.int128
        sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
        sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
        sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade/Tests/upgrade.stable.out
        sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
        sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
        testing/Mtest.py.in
        testing/malcheck.py
        tools/merovingian/daemon/merovingian.c
Branch: tracer
Log Message:

Merge with default


diffs (truncated from 8517 to 300 lines):

diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -508,9 +508,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #define HAVE_SYS_STAT_H 1
 
-/* Define to 1 if you have the <sys/sysctl.h> header file. */
-/* #undef HAVE_SYS_SYSCTL_H */
-
 /* Define to 1 if you have the <sys/times.h> header file. */
 /* #undef HAVE_SYS_TIMES_H */
 
diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -660,6 +660,7 @@ stdout of test 'MAL-signatures` in direc
 [ "bat",       "orderidx",     "pattern bat.orderidx(bv:bat[:any_1]):void ",   
"OIDXcreate;",  "Introduces the OID index arrangement of ordered values"        
]
 [ "bat",       "orderidx",     "pattern bat.orderidx(bv:bat[:any_1], 
pieces:int):void ",       "OIDXcreate;",  "Introduces the OID index arrangement 
of ordered values"        ]
 [ "bat",       "orderidx",     "pattern bat.orderidx(bv:bat[:any_1], 
l:bat[:any_1]...):void ", "OIDXmerge;",   "Consolidates the OID index 
arrangement"        ]
+[ "bat",       "pack", "pattern bat.pack(X_0:any_2...):bat[:any_2] ",  
"MATpackValues;",       "Materialize the values into a BAT. Avoiding a clash 
with mat.pack() in mergetable"     ]
 [ "bat",       "partition",    "pattern bat.partition(b:bat[:any_1], 
pieces:int, n:int):bat[:any_1] ", "CMDBATpartition2;",    "Create the n-th 
slice over the BAT broken into several pieces."        ]
 [ "bat",       "partition",    "pattern 
bat.partition(b:bat[:any_1]):bat[:any_1]... ", "CMDBATpartition;",     "Create 
a serie of slices over the BAT argument. The BUNs are distributed evenly."      
]
 [ "bat",       "replace",      "command bat.replace(b:bat[:any_1], 
rid:bat[:oid], val:bat[:any_1]):bat[:any_1] ",      "BKCbat_inplace;",      
"Perform replace for all BUNs of the second BAT into the first."        ]
@@ -11543,9 +11544,11 @@ stdout of test 'MAL-signatures` in direc
 [ "profiler",  "getSystemTime",        "command profiler.getSystemTime():lng 
",        "CMDgetSystemTime;",    "Obtain the user timing information."   ]
 [ "profiler",  "getTrace",     "pattern profiler.getTrace(e:str):bat[:any_1] 
",        "CMDgetTrace;", "Get the trace details of a specific event"     ]
 [ "profiler",  "getUserTime",  "command profiler.getUserTime():lng ",  
"CMDgetUserTime;",      "Obtain the user timing information."   ]
+[ "profiler",  "getlimit",     "command profiler.getlimit():int ",     
"CMDgetprofilerlimit;", "Set profiler limit"    ]
 [ "profiler",  "noop", "command profiler.noop():void ",        
"CMDnoopProfiler;",     "Fetch any pending performance events"  ]
 [ "profiler",  "openstream",   "pattern profiler.openstream():void ",  
"CMDopenProfilerStream;",       "Start profiling the events, send to output 
stream"     ]
 [ "profiler",  "setheartbeat", "command profiler.setheartbeat(b:int):void ",   
"CMDsetHeartbeat;",     "Set heart beat performance tracing"    ]
+[ "profiler",  "setlimit",     "command profiler.setlimit(l:int):void ",       
"CMDsetprofilerlimit;", "Get profiler limit"    ]
 [ "profiler",  "start",        "pattern profiler.start():void ",       
"CMDstartProfiler;",    "Start offline performance profiling"   ]
 [ "profiler",  "starttrace",   "pattern profiler.starttrace():void ",  
"CMDstartTrace;",       "Start collecting trace information"    ]
 [ "profiler",  "stop", "pattern profiler.stop():void ",        
"CMDstopProfiler;",     "Stop offline performance profiling"    ]
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -766,6 +766,7 @@ stdout of test 'MAL-signatures` in direc
 [ "bat",       "orderidx",     "pattern bat.orderidx(bv:bat[:any_1]):void ",   
"OIDXcreate;",  "Introduces the OID index arrangement of ordered values"        
]
 [ "bat",       "orderidx",     "pattern bat.orderidx(bv:bat[:any_1], 
pieces:int):void ",       "OIDXcreate;",  "Introduces the OID index arrangement 
of ordered values"        ]
 [ "bat",       "orderidx",     "pattern bat.orderidx(bv:bat[:any_1], 
l:bat[:any_1]...):void ", "OIDXmerge;",   "Consolidates the OID index 
arrangement"        ]
+[ "bat",       "pack", "pattern bat.pack(X_0:any_2...):bat[:any_2] ",  
"MATpackValues;",       "Materialize the values into a BAT. Avoiding a clash 
with mat.pack() in mergetable"     ]
 [ "bat",       "partition",    "pattern bat.partition(b:bat[:any_1], 
pieces:int, n:int):bat[:any_1] ", "CMDBATpartition2;",    "Create the n-th 
slice over the BAT broken into several pieces."        ]
 [ "bat",       "partition",    "pattern 
bat.partition(b:bat[:any_1]):bat[:any_1]... ", "CMDBATpartition;",     "Create 
a serie of slices over the BAT argument. The BUNs are distributed evenly."      
]
 [ "bat",       "replace",      "command bat.replace(b:bat[:any_1], 
rid:bat[:oid], val:bat[:any_1]):bat[:any_1] ",      "BKCbat_inplace;",      
"Perform replace for all BUNs of the second BAT into the first."        ]
@@ -15947,9 +15948,11 @@ stdout of test 'MAL-signatures` in direc
 [ "profiler",  "getSystemTime",        "command profiler.getSystemTime():lng 
",        "CMDgetSystemTime;",    "Obtain the user timing information."   ]
 [ "profiler",  "getTrace",     "pattern profiler.getTrace(e:str):bat[:any_1] 
",        "CMDgetTrace;", "Get the trace details of a specific event"     ]
 [ "profiler",  "getUserTime",  "command profiler.getUserTime():lng ",  
"CMDgetUserTime;",      "Obtain the user timing information."   ]
+[ "profiler",  "getlimit",     "command profiler.getlimit():int ",     
"CMDgetprofilerlimit;", "Set profiler limit"    ]
 [ "profiler",  "noop", "command profiler.noop():void ",        
"CMDnoopProfiler;",     "Fetch any pending performance events"  ]
 [ "profiler",  "openstream",   "pattern profiler.openstream():void ",  
"CMDopenProfilerStream;",       "Start profiling the events, send to output 
stream"     ]
 [ "profiler",  "setheartbeat", "command profiler.setheartbeat(b:int):void ",   
"CMDsetHeartbeat;",     "Set heart beat performance tracing"    ]
+[ "profiler",  "setlimit",     "command profiler.setlimit(l:int):void ",       
"CMDsetprofilerlimit;", "Get profiler limit"    ]
 [ "profiler",  "start",        "pattern profiler.start():void ",       
"CMDstartProfiler;",    "Start offline performance profiling"   ]
 [ "profiler",  "starttrace",   "pattern profiler.starttrace():void ",  
"CMDstartTrace;",       "Start collecting trace information"    ]
 [ "profiler",  "stop", "pattern profiler.stop():void ",        
"CMDstopProfiler;",     "Stop offline performance profiling"    ]
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
@@ -2418,6 +2418,7 @@ InstrPtr newFcnCall(MalBlkPtr mb, char *
 Symbol newFunction(str mod, str nme, int kind);
 MalStkPtr newGlobalStack(int size);
 InstrPtr newInstruction(MalBlkPtr mb, str modnme, str fcnnme);
+InstrPtr newInstructionArgs(MalBlkPtr mb, str modnme, str fcnnme, int args);
 MalBlkPtr newMalBlk(int elements);
 int newMalBlkStmt(MalBlkPtr mb, int elements);
 Plant newPlant(MalBlkPtr mb);
@@ -2425,6 +2426,7 @@ InstrPtr newRaiseStmt(MalBlkPtr mb, str 
 str newRef;
 InstrPtr newReturnStmt(MalBlkPtr mb);
 InstrPtr newStmt(MalBlkPtr mb, const char *module, const char *name);
+InstrPtr newStmtArgs(MalBlkPtr mb, const char *module, const char *name, int 
args);
 Symbol newSymbol(str nme, int kind);
 int newTmpVariable(MalBlkPtr mb, malType type);
 int newTypeVariable(MalBlkPtr mb, malType type);
diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -2575,8 +2575,7 @@ dump_database(Mapi mid, stream *toConsol
                goto bailout;
 
        /* start a transaction for the dump */
-       if (!describe)
-               mnstr_printf(toConsole, "%s;\n", start_trx);
+       mnstr_printf(toConsole, "%s;\n", start_trx);
 
        if ((hdl = mapi_query(mid, start_trx)) == NULL || mapi_error(mid))
                goto bailout;
@@ -3095,8 +3094,7 @@ dump_database(Mapi mid, stream *toConsol
        mapi_close_handle(hdl);
 
        /* finally commit the whole transaction */
-       if (!describe)
-               mnstr_printf(toConsole, "COMMIT;\n");
+       mnstr_printf(toConsole, "COMMIT;\n");
        if (sname)
                free(sname);
        if (query)
diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c
--- a/clients/mapiclient/mhelp.c
+++ b/clients/mapiclient/mhelp.c
@@ -87,7 +87,7 @@ SQLhelp sqlhelp1[] = {
        {"ANALYZE",
         "Collect column/table/schema data statistics for analysis and 
optimizer usage",
         "ANALYZE ident [ . ident [ column_list ] ] [SAMPLE size] [MINMAX]",
-        "column_list",
+        "ident,column_list",
         "See also 
https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/statistics"},
        {"CALL",
         "",
@@ -163,10 +163,10 @@ SQLhelp sqlhelp1[] = {
         
"qname,param,data_type,function_return,statement,ident,language_keyword,external_code",
         "See also 
https://www.monetdb.org/Documentation/Manuals/SQLreference/Functions"},
        {"CREATE INDEX",
-        "",
+        "Create a hint for a secondary index on a column or set of columns of 
a table",
         "CREATE [ UNIQUE | ORDERED | IMPRINTS ] INDEX ident ON qname '(' 
ident_list ')'",
         NULL,
-        NULL},
+        "See also 
https://www.monetdb.org/Documentation/Manuals/SQLreference/Indices"},
        {"CREATE PROCEDURE",
         "Create a user-defined procedure",
         "CREATE [ OR REPLACE ] PROCEDURE qname '(' { '*' | [ param [',' ...]] 
} ')'\n"
@@ -203,12 +203,12 @@ SQLhelp sqlhelp1[] = {
         "ident",
         "See also https://www.monetdb.org/Documentation/SQLreference/Roles"},
        {"CREATE SCHEMA",
-        "",
+        "Create a new schema",
         "CREATE SCHEMA [ IF NOT EXISTS ] schema_name [default_char_set] 
[path_spec] [schema_element]",
         "schema_name,default_char_set,path_spec,schema_element",
         "See also https://www.monetdb.org/Documentation/SQLreference/Schema"},
        {"CREATE SEQUENCE",
-        "Define a new sequence generator",
+        "Define a new integer number sequence generator",
         "CREATE SEQUENCE ident [ AS data_type] [ START [WITH start]] 
[INCREMENT BY increment]\n"
         "[MINVALUE minvalue | NO MINVALUE] [MAXVALUE maxvalue | NO MAXVALUE] 
[CACHE cachevalue] [[NO] CYCLE]",
         "ident,data_type",
@@ -219,17 +219,18 @@ SQLhelp sqlhelp1[] = {
         "table_source",
         NULL},
        {"CREATE TABLE",
-        "",
+        "Create a new table",
         "CREATE TABLE [ IF NOT EXISTS ] qname table_source [STORAGE ident 
string]\n"
         "CREATE TABLE [ IF NOT EXISTS ] qname FROM LOADER function_ref\n"
         "CREATE [ LOCAL | GLOBAL ] { TEMPORARY | TEMP } TABLE [ IF NOT EXISTS 
] qname table_source [on_commit]",
         "table_source,on_commit,function_ref",
         "See also 
https://www.monetdb.org/Documentation/Manuals/SQLreference/Tables"},
        {"CREATE TRIGGER",
-        "",
-        "CREATE [ OR REPLACE ] TRIGGER qname { BEFORE | AFTER } { INSERT | 
DELETE | TRUNCATE ...\n"
-        " | UPDATE [ OF ident [',' ident]] } ON qname REFERENCING 
trigger_reference... triggered_action",
-        "qname,trigger_reference,triggered_action",
+        "Define a triggered action for a table data update event",
+        "CREATE [ OR REPLACE ] TRIGGER qname { BEFORE | AFTER }\n"
+        " { INSERT | DELETE | TRUNCATE | UPDATE [ OF ident_list ] }\n"
+        " ON qname [ REFERENCING trigger_reference [...] ] triggered_action",
+        "qname,ident_list,trigger_reference,triggered_action",
         "See also 
https://www.monetdb.org/Documentation/SQLreference/Triggers"},
        {"CREATE TYPE",
         "Add user defined type to the type system ",
@@ -237,12 +238,12 @@ SQLhelp sqlhelp1[] = {
         NULL,
         NULL},
        {"CREATE USER",
-        "Create a new user",
+        "Create a new database user",
         "CREATE USER ident WITH [ENCRYPTED | UNENCRYPTED] PASSWORD string NAME 
string SCHEMA ident",
         "ident",
         "See also https://www.monetdb.org/Documentation/SQLreference/Users"},
        {"CREATE VIEW",
-        "",
+        "Create a new view",
         "CREATE [ OR REPLACE ] VIEW qname [ column_list ] AS { 
query_expression | '(' query_expression ')' }\n"
         "[ WITH CHECK OPTION ]",
         "qname,column_list,query_expression",
@@ -850,7 +851,7 @@ SQLhelp sqlhelp2[] = {
         NULL},
        {"trigger_reference",
         NULL,
-        "OLD [ROW] [AS] ident | NEW [ROW] [AS] ident",
+        "{ OLD | NEW } { [ROW] | TABLE } [AS] ident",
         NULL,
         NULL},
        {"update_statement",
@@ -860,8 +861,9 @@ SQLhelp sqlhelp2[] = {
         NULL},
        {"triggered_action",
         NULL,
-        "[ FOR EACH { ROW | STATEMENT } ] [ WHEN '(' search_condition ')'\n"
-        "        BEGIN ATOMIC trigger_statement ... END ",
+        "[ FOR [EACH] { ROW | STATEMENT } ]\n"
+        "[ WHEN '(' search_condition ')' ]\n"
+        "{ trigger_statement | BEGIN ATOMIC trigger_statement [ ; ... ] END }",
         "trigger_statement,search_condition",
         NULL},
        {"trigger_statement",
diff --git a/clients/mapiclient/msqldump.c b/clients/mapiclient/msqldump.c
--- a/clients/mapiclient/msqldump.c
+++ b/clients/mapiclient/msqldump.c
@@ -226,11 +226,15 @@ main(int argc, char **argv)
                dump_version(mid, out, "-- server:");
                mnstr_printf(out, "-- %s\n", buf);
        }
-       if (functions)
+       if (functions) {
+               mnstr_printf(out, "START TRANSACTION;\n");
                c = dump_functions(mid, out, true, NULL, NULL, NULL);
-       else if (table)
+               mnstr_printf(out, "COMMIT;\n");
+       } else if (table) {
+               mnstr_printf(out, "START TRANSACTION;\n");
                c = dump_table(mid, NULL, table, out, describe, true, 
useinserts, false);
-       else
+               mnstr_printf(out, "COMMIT;\n");
+       } else
                c = dump_database(mid, out, describe, useinserts);
        mnstr_flush(out);
 
diff --git a/common/utils/mutils.c b/common/utils/mutils.c
--- a/common/utils/mutils.c
+++ b/common/utils/mutils.c
@@ -25,10 +25,10 @@
 #include <limits.h>            /* PATH_MAX on Solaris */
 
 #ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>  /* realpath on OSX, prerequisite of sys/sysctl on 
OpenBSD */
+# include <sys/param.h>  /* realpath on OSX */
 #endif
 
-#ifdef HAVE_SYS_SYSCTL_H
+#ifdef BSD /* BSD macro is defined in sys/param.h */
 # include <sys/sysctl.h>  /* KERN_PROC_PATHNAME on BSD */
 #endif
 
@@ -454,7 +454,7 @@ get_bin_path(void)
        if (_NSGetExecutablePath(buf, &size) == 0 &&
                        realpath(buf, _bin_path) != NULL)
        return _bin_path;
-#elif defined(HAVE_SYS_SYSCTL_H) && defined(KERN_PROC_PATHNAME)  /* BSD */
+#elif defined(BSD) && defined(KERN_PROC_PATHNAME)  /* BSD */
        int mib[4];
        size_t cb = sizeof(_bin_path);
        mib[0] = CTL_KERN;
diff --git a/gdk/gdk_analytic_bounds.c b/gdk/gdk_analytic_bounds.c
--- a/gdk/gdk_analytic_bounds.c
+++ b/gdk/gdk_analytic_bounds.c
@@ -39,76 +39,144 @@
                lng m = k - 1;                                          \
                TPE1 v, calc;                                           \
                TPE2 rlimit;                                            \
-               for (; k < i; k++, rb++) {                              \
-                       rlimit = (TPE2) LIMIT;                          \
-                       v = bp[k];                                      \
-                       if (is_##TPE1##_nil(v)) {                       \
+               if (b->tnonil) {                                \
+                       for (; k < i; k++, rb++) {      \
+                               rlimit = (TPE2) LIMIT;  \
+                               v = bp[k];      \
                                for (j = k; ; j--) {                    \
                                        if (j == m)                     \
                                                break;                  \
-                                       if (!is_##TPE1##_nil(bp[j]))    \
-                                               break;                  \
-                               }                                       \
-                       } else {                                        \
-                               for (j = k; ; j--) {                    \
-                                       if (j == m)                     \
-                                               break;                  \
-                                       if (is_##TPE1##_nil(bp[j]))     \
-                                               break;                  \
                                        SUB_WITH_CHECK(v, bp[j], TPE1, calc, 
GDK_##TPE1##_max, goto calc_overflow); \
                                        if ((TPE2)(ABSOLUTE(calc)) > rlimit) \
                                                break;                  \
                                }                                       \
-                       }                                               \
-                       j++;                                            \
-                       *rb = j;                                        \
-               }                                                       \
+                               j++;                                            
\
+                               *rb = j;                                        
\
+                       }                                                       
\
+               } else { \
+                       for (; k < i; k++, rb++) {                              
\
+                               rlimit = (TPE2) LIMIT;                          
\
+                               v = bp[k];                                      
\
+                               if (is_##TPE1##_nil(v)) {                       
\
+                                       for (j = k; ; j--) {                    
\
+                                               if (j == m)                     
\
+                                                       break;                  
\
+                                               if (!is_##TPE1##_nil(bp[j]))    
\
+                                                       break;                  
\
+                                       }                                       
\
+                               } else {                                        
\
+                                       for (j = k; ; j--) {                    
\
+                                               if (j == m)                     
\
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to