Changeset: 1ab0511ef7b5 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1ab0511ef7b5 Modified Files: clients/Tests/MAL-signatures.stable.out clients/Tests/MAL-signatures.stable.out.int128 clients/Tests/exports.stable.out clients/mapiclient/dump.c clients/mapiclient/mclient.1 clients/mapilib/mapi.c clients/odbc/driver/SQLPrepare.c common/utils/msabaoth.c common/utils/msabaoth.h gdk/gdk.h gdk/gdk_atoms.h gdk/gdk_bat.c gdk/gdk_batop.c gdk/gdk_bbp.c gdk/gdk_calc.c gdk/gdk_firstn.c gdk/gdk_heap.c gdk/gdk_imprints.c gdk/gdk_join.c gdk/gdk_logger.c gdk/gdk_posix.c gdk/gdk_private.h gdk/gdk_select.c gdk/gdk_storage.c gdk/gdk_string.c gdk/gdk_utils.c gdk/gdk_value.c monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows monetdb5/extras/rapi/converters.c.h monetdb5/mal/Tests/All monetdb5/mal/mal_exception.c monetdb5/mal/mal_instruction.c monetdb5/mal/mal_interpreter.c monetdb5/mal/mal_linker.c monetdb5/mal/mal_parser.c monetdb5/modules/atoms/uuid.c monetdb5/modules/kernel/algebra.mal sql/backends/monet5/UDF/pyapi/pyheader.h sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_rank.c sql/backends/monet5/sql_rank.mal sql/backends/monet5/wlr.c sql/server/rel_select.c sql/server/sql_parser.y sql/test/BugDay_2005-10-06_2.9.3/Tests/having.SF-922614.stable.err sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out sql/test/analytics/Tests/analytics10.sql sql/test/analytics/Tests/analytics10.stable.err sql/test/analytics/Tests/analytics10.stable.out sql/test/miscellaneous/Tests/groupby_expressions.sql sql/test/miscellaneous/Tests/groupby_expressions.stable.err sql/test/miscellaneous/Tests/groupby_expressions.stable.out testing/Mfilter.py testing/difflib.c tools/merovingian/client/monetdb.c tools/merovingian/daemon/client.c tools/merovingian/daemon/connections.c tools/merovingian/daemon/controlrunner.c tools/merovingian/daemon/forkmserver.c tools/merovingian/daemon/multiplex-funnel.c tools/merovingian/daemon/proxy.c tools/merovingian/utils/control.c tools/merovingian/utils/utils.c Branch: statistics-analytics Log Message:
Merge with default diffs (truncated from 3273 to 300 lines): 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 @@ -589,15 +589,15 @@ stdout of test 'MAL-signatures` in direc [ "algebra", "slice", "command algebra.slice(b:bat[:any_1], x:int, y:int):bat[:any_1] ", "ALGslice_int;", "Return the slice with the BUNs at position x till y." ] [ "algebra", "slice", "command algebra.slice(b:bat[:any_1], x:lng, y:lng):bat[:any_1] ", "ALGslice_lng;", "Return the slice with the BUNs at position x till y." ] [ "algebra", "slice", "command algebra.slice(b:bat[:any_1], x:oid, y:oid):bat[:any_1] ", "ALGslice_oid;", "Return the slice based on head oid x till y (exclusive)." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], reverse:bit, nilslast:bit, stable:bit):bat[:any_1] ", "ALGsort11;", "Returns a copy of the BAT sorted on tail values.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid]) ", "ALGsort12;", "Returns a copy of the BAT sorted on tail values and a BAT that\n specifies how the input was reordered.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid], X_2:bat[:oid]) ", "ALGsort13;", "Returns a copy of the BAT sorted on tail values, a BAT that specifies\n how the input was reordered, and a BAT with group information.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], reverse:bit, nilslast:bit, stable:bit):bat[:any_1] ", "ALGsort21;", "Returns a copy of the BAT sorted on tail values.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid]) ", "ALGsort22;", "Returns a copy of the BAT sorted on tail values and a BAT that\n specifies how the input was reordered.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid], X_2:bat[:oid]) ", "ALGsort23;", "Returns a copy of the BAT sorted on tail values, a BAT that specifies\n how the input was reordered, and a BAT with group information.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], g:bat[:oid], reverse:bit, nilslast:bit, stable:bit):bat[:any_1] ", "ALGsort31;", "Returns a copy of the BAT sorted on tail values.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], g:bat[:oid], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid]) ", "ALGsort32;", "Returns a copy of the BAT sorted on tail values and a BAT that\n specifies how the input was reordered.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], g:bat[:oid], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid], X_2:bat[:oid]) ", "ALGsort33;", "Returns a copy of the BAT sorted on tail values, a BAT that specifies\n how the input was reordered, and a BAT with group information.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], reverse:bit, nilslast:bit, stable:bit):bat[:any_1] ", "ALGsort11;", "Returns a copy of the BAT sorted on tail values.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid]) ", "ALGsort12;", "Returns a copy of the BAT sorted on tail values and a BAT that\n specifies how the input was reordered.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid], X_2:bat[:oid]) ", "ALGsort13;", "Returns a copy of the BAT sorted on tail values, a BAT that specifies\n how the input was reordered, and a BAT with group information.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], reverse:bit, nilslast:bit, stable:bit):bat[:any_1] ", "ALGsort21;", "Returns a copy of the BAT sorted on tail values.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid]) ", "ALGsort22;", "Returns a copy of the BAT sorted on tail values and a BAT that\n specifies how the input was reordered.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid], X_2:bat[:oid]) ", "ALGsort23;", "Returns a copy of the BAT sorted on tail values, a BAT that specifies\n how the input was reordered, and a BAT with group information.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], g:bat[:oid], reverse:bit, nilslast:bit, stable:bit):bat[:any_1] ", "ALGsort31;", "Returns a copy of the BAT sorted on tail values.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], g:bat[:oid], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid]) ", "ALGsort32;", "Returns a copy of the BAT sorted on tail values and a BAT that\n specifies how the input was reordered.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], g:bat[:oid], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid], X_2:bat[:oid]) ", "ALGsort33;", "Returns a copy of the BAT sorted on tail values, a BAT that specifies\n how the input was reordered, and a BAT with group information.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] [ "algebra", "subslice", "command algebra.subslice(b:bat[:any_1], x:lng, y:lng):bat[:oid] ", "ALGsubslice_lng;", "Return the oids of the slice with the BUNs at position x till y." ] [ "algebra", "thetajoin", "command algebra.thetajoin(l:bat[:any_1], r:bat[:any_1], sl:bat[:oid], sr:bat[:oid], op:int, nil_matches:bit, estimate:lng) (X_0:bat[:oid], X_1:bat[:oid]) ", "ALGthetajoin;", "Theta join with candidate lists" ] [ "algebra", "thetaselect", "command algebra.thetaselect(b:bat[:any_1], val:any_1, op:str):bat[:oid] ", "ALGthetaselect1;", "Select all head values for which the tail value obeys the relation\n\tvalue OP VAL.\n\tInput is a dense-headed BAT, output is a dense-headed BAT with in\n\tthe tail the head value of the input BAT for which the\n\trelationship holds. The output BAT is sorted on the tail value." ] @@ -8977,7 +8977,9 @@ stdout of test 'MAL-signatures` in direc [ "batsql", "dec_round", "command batsql.dec_round(v:bat[:sht], r:sht):bat[:sht] ", "sht_bat_dec_round_wrap;", "round off the value v to nearests multiple of r" ] [ "batsql", "dense_rank", "pattern batsql.dense_rank(b:bat[:any_1], p:any_2, o:any_3):bat[:int] ", "SQLdense_rank;", "return the densely ranked groups" ] [ "batsql", "diff", "pattern batsql.diff(b:bat[:any_1]):bat[:bit] ", "SQLdiff;", "return true if cur != prev row" ] +[ "batsql", "diff", "pattern batsql.diff(p:bat[:bit], b:any_1):bat[:bit] ", "SQLdiff;", "return true if cur != prev row" ] [ "batsql", "diff", "pattern batsql.diff(p:bat[:bit], b:bat[:any_1]):bat[:bit] ", "SQLdiff;", "return true if cur != prev row" ] +[ "batsql", "diff", "pattern batsql.diff(p:bit, b:bat[:any_1]):bat[:bit] ", "SQLdiff;", "return true if cur != prev row" ] [ "batsql", "first_value", "pattern batsql.first_value(b:bat[:any_1], s:bat[:lng], e:bat[:lng]):bat[:any_1] ", "SQLfirst_value;", "return the first value of groups" ] [ "batsql", "get_value", "pattern batsql.get_value(sname:bat[:str], sequence:bat[:str]):bat[:lng] ", "mvc_bat_get_value;", "return the current value of sequences" ] [ "batsql", "get_value", "pattern batsql.get_value(sname:bat[:str], sequence:str):bat[:lng] ", "mvc_bat_get_value;", "return the current value of the sequence" ] 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 @@ -693,15 +693,15 @@ stdout of test 'MAL-signatures` in direc [ "algebra", "slice", "command algebra.slice(b:bat[:any_1], x:int, y:int):bat[:any_1] ", "ALGslice_int;", "Return the slice with the BUNs at position x till y." ] [ "algebra", "slice", "command algebra.slice(b:bat[:any_1], x:lng, y:lng):bat[:any_1] ", "ALGslice_lng;", "Return the slice with the BUNs at position x till y." ] [ "algebra", "slice", "command algebra.slice(b:bat[:any_1], x:oid, y:oid):bat[:any_1] ", "ALGslice_oid;", "Return the slice based on head oid x till y (exclusive)." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], reverse:bit, nilslast:bit, stable:bit):bat[:any_1] ", "ALGsort11;", "Returns a copy of the BAT sorted on tail values.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid]) ", "ALGsort12;", "Returns a copy of the BAT sorted on tail values and a BAT that\n specifies how the input was reordered.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid], X_2:bat[:oid]) ", "ALGsort13;", "Returns a copy of the BAT sorted on tail values, a BAT that specifies\n how the input was reordered, and a BAT with group information.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], reverse:bit, nilslast:bit, stable:bit):bat[:any_1] ", "ALGsort21;", "Returns a copy of the BAT sorted on tail values.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid]) ", "ALGsort22;", "Returns a copy of the BAT sorted on tail values and a BAT that\n specifies how the input was reordered.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid], X_2:bat[:oid]) ", "ALGsort23;", "Returns a copy of the BAT sorted on tail values, a BAT that specifies\n how the input was reordered, and a BAT with group information.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], g:bat[:oid], reverse:bit, nilslast:bit, stable:bit):bat[:any_1] ", "ALGsort31;", "Returns a copy of the BAT sorted on tail values.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], g:bat[:oid], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid]) ", "ALGsort32;", "Returns a copy of the BAT sorted on tail values and a BAT that\n specifies how the input was reordered.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] -[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], g:bat[:oid], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid], X_2:bat[:oid]) ", "ALGsort33;", "Returns a copy of the BAT sorted on tail values, a BAT that specifies\n how the input was reordered, and a BAT with group information.\n The input and output are (must be) dense headed.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], reverse:bit, nilslast:bit, stable:bit):bat[:any_1] ", "ALGsort11;", "Returns a copy of the BAT sorted on tail values.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid]) ", "ALGsort12;", "Returns a copy of the BAT sorted on tail values and a BAT that\n specifies how the input was reordered.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid], X_2:bat[:oid]) ", "ALGsort13;", "Returns a copy of the BAT sorted on tail values, a BAT that specifies\n how the input was reordered, and a BAT with group information.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], reverse:bit, nilslast:bit, stable:bit):bat[:any_1] ", "ALGsort21;", "Returns a copy of the BAT sorted on tail values.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid]) ", "ALGsort22;", "Returns a copy of the BAT sorted on tail values and a BAT that\n specifies how the input was reordered.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid], X_2:bat[:oid]) ", "ALGsort23;", "Returns a copy of the BAT sorted on tail values, a BAT that specifies\n how the input was reordered, and a BAT with group information.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], g:bat[:oid], reverse:bit, nilslast:bit, stable:bit):bat[:any_1] ", "ALGsort31;", "Returns a copy of the BAT sorted on tail values.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], g:bat[:oid], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid]) ", "ALGsort32;", "Returns a copy of the BAT sorted on tail values and a BAT that\n specifies how the input was reordered.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] +[ "algebra", "sort", "command algebra.sort(b:bat[:any_1], o:bat[:oid], g:bat[:oid], reverse:bit, nilslast:bit, stable:bit) (X_0:bat[:any_1], X_1:bat[:oid], X_2:bat[:oid]) ", "ALGsort33;", "Returns a copy of the BAT sorted on tail values, a BAT that specifies\n how the input was reordered, and a BAT with group information.\n The order is descending if the reverse bit is set.\n\t\t This is a stable sort if the stable bit is set." ] [ "algebra", "subslice", "command algebra.subslice(b:bat[:any_1], x:lng, y:lng):bat[:oid] ", "ALGsubslice_lng;", "Return the oids of the slice with the BUNs at position x till y." ] [ "algebra", "thetajoin", "command algebra.thetajoin(l:bat[:any_1], r:bat[:any_1], sl:bat[:oid], sr:bat[:oid], op:int, nil_matches:bit, estimate:lng) (X_0:bat[:oid], X_1:bat[:oid]) ", "ALGthetajoin;", "Theta join with candidate lists" ] [ "algebra", "thetaselect", "command algebra.thetaselect(b:bat[:any_1], val:any_1, op:str):bat[:oid] ", "ALGthetaselect1;", "Select all head values for which the tail value obeys the relation\n\tvalue OP VAL.\n\tInput is a dense-headed BAT, output is a dense-headed BAT with in\n\tthe tail the head value of the input BAT for which the\n\trelationship holds. The output BAT is sorted on the tail value." ] @@ -12699,7 +12699,9 @@ stdout of test 'MAL-signatures` in direc [ "batsql", "dec_round", "command batsql.dec_round(v:bat[:sht], r:sht):bat[:sht] ", "sht_bat_dec_round_wrap;", "round off the value v to nearests multiple of r" ] [ "batsql", "dense_rank", "pattern batsql.dense_rank(b:bat[:any_1], p:any_2, o:any_3):bat[:int] ", "SQLdense_rank;", "return the densely ranked groups" ] [ "batsql", "diff", "pattern batsql.diff(b:bat[:any_1]):bat[:bit] ", "SQLdiff;", "return true if cur != prev row" ] +[ "batsql", "diff", "pattern batsql.diff(p:bat[:bit], b:any_1):bat[:bit] ", "SQLdiff;", "return true if cur != prev row" ] [ "batsql", "diff", "pattern batsql.diff(p:bat[:bit], b:bat[:any_1]):bat[:bit] ", "SQLdiff;", "return true if cur != prev row" ] +[ "batsql", "diff", "pattern batsql.diff(p:bit, b:bat[:any_1]):bat[:bit] ", "SQLdiff;", "return true if cur != prev row" ] [ "batsql", "first_value", "pattern batsql.first_value(b:bat[:any_1], s:bat[:lng], e:bat[:lng]):bat[:any_1] ", "SQLfirst_value;", "return the first value of groups" ] [ "batsql", "get_value", "pattern batsql.get_value(sname:bat[:str], sequence:bat[:str]):bat[:lng] ", "mvc_bat_get_value;", "return the current value of sequences" ] [ "batsql", "get_value", "pattern batsql.get_value(sname:bat[:str], sequence:str):bat[:lng] ", "mvc_bat_get_value;", "return the current value of the sequence" ] 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 @@ -1909,17 +1909,20 @@ str URLnew4(url *u, str *protocol, str * str URLnoop(url *u, url *val); ssize_t URLtoString(str *s, size_t *len, const char *src, bool external); int UUIDcompare(const uuid *l, const uuid *r); -str UUIDequal(bit *retval, uuid **l, uuid **r); ssize_t UUIDfromString(const char *svalue, size_t *len, uuid **retval, bool external); str UUIDgenerateUuid(uuid **retval); +str UUIDgenerateUuid(uuid *retval); str UUIDgenerateUuidInt(uuid **retval, int *d); +str UUIDgenerateUuidInt(uuid *retval, int *d); BUN UUIDhash(const void *u); str UUIDisaUUID(bit *retval, str *u); const uuid *UUIDnull(void); str UUIDprelude(void *ret); uuid *UUIDread(uuid *u, stream *s, size_t cnt); str UUIDstr2uuid(uuid **retval, str *s); +str UUIDstr2uuid(uuid *retval, str *s); ssize_t UUIDtoString(str *retval, size_t *len, const uuid *value, bool external); +str UUIDuuid2str(str *retval, const uuid *u); str UUIDuuid2str(str *retval, uuid **u); gdk_return UUIDwrite(const uuid *u, stream *s, size_t cnt); str WLCaction(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); @@ -2392,6 +2395,7 @@ char monet_characteristics[4096]; char monet_cwd[FILENAME_MAX]; void moveInstruction(MalBlkPtr mb, int pc, int target); void msab_dbfarminit(const char *dbfarm); +void msab_dbnameinit(const char *dbname); void msab_dbpathinit(const char *dbpath); char *msab_deserialise(sabdb **ret, char *sabdb); void msab_freeStatus(sabdb **ret); diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c --- a/clients/mapiclient/dump.c +++ b/clients/mapiclient/dump.c @@ -434,8 +434,15 @@ dump_foreign_keys(Mapi mid, const char * char *t = sescape(tname); maxquerylen = 1024 + strlen(t) + strlen(s); query = malloc(maxquerylen); - if (query == NULL) + if (s == NULL || t == NULL || query == NULL) { + if (s) + free(s); + if (t) + free(t); + if (query) + free(query); goto bailout; + } snprintf(query, maxquerylen, "SELECT ps.name, " /* 0 */ "pkt.name, " /* 1 */ @@ -890,8 +897,13 @@ dump_column_definition(Mapi mid, stream t = tname ? sescape(tname) : NULL; s = schema ? sescape(schema) : NULL; if (tid == NULL) { - if (tname == NULL || schema == NULL) + if (tname == NULL || schema == NULL) { + if (t != NULL) + free(t); + if (s != NULL) + free(s); return 1; + } maxquerylen += 2 * strlen(tname) + 2 * strlen(schema); } else @@ -1921,12 +1933,17 @@ dump_function(Mapi mid, stream *toConsol fname = strdup(fname); ftkey = strdup(ftkey); - if (!remark || !sname || !fname || !ftkey) { - free(remark); - free(sname); - free(fname); - free(ftkey); - free(query); + if (remark == NULL || sname == NULL || fname == NULL || ftkey == NULL) { + if (remark) + free(remark); + if (sname) + free(sname); + if (fname) + free(fname); + if (ftkey) + free(ftkey); + if (query) + free(query); goto bailout; } } @@ -1953,8 +1970,7 @@ dump_function(Mapi mid, stream *toConsol } /* strdup these two because they are needed after another query */ if (flkey) { - char* nflkey = flkey ? strdup(flkey) : NULL; - if (!nflkey) { + if ((flkey = strdup(flkey)) == NULL) { if (remark) { free(remark); free(sname); @@ -1962,8 +1978,7 @@ dump_function(Mapi mid, stream *toConsol free(ftkey); } goto bailout; - } else - flkey = nflkey; + } } ffunc = strdup(ffunc); query_len = snprintf(query, query_size, @@ -2702,8 +2717,8 @@ dump_database(Mapi mid, stream *toConsol } else { mnstr_printf(toConsole, "SET SCHEMA "); dquoted_print(toConsole, sname, ";\n"); - curschema = sname ? strdup(sname) : NULL; - if (sname && !curschema) + curschema = strdup(sname); + if (curschema == NULL) goto bailout; } diff --git a/clients/mapiclient/mclient.1 b/clients/mapiclient/mclient.1 --- a/clients/mapiclient/mclient.1 +++ b/clients/mapiclient/mclient.1 @@ -451,7 +451,7 @@ is the name of the table, .I $db is the name of the database. .PP -mclient \-d $db \-s \(dqCOPY INTO $table FROM '$file' USING DELIMITERS ',','\e\en','\e\(dq'\(dq +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). @@ -462,7 +462,7 @@ is the name of the table, .I $db is the name of the database. .PP -mclient \-d $db \-s \(dqCOPY INTO $table FROM STDIN USING DELIMITERS ',','\e\en','\e\(dq'\(dq \- < $file +mclient \-d $db \-s \(dqCOPY INTO $table FROM STDIN USING DELIMITERS ',',E'\e\en','\e\(dq'\(dq \- < $file .PP Note that in this latter case, if a count of records is supplied, it should be at least as large as the number of records actually present @@ -471,10 +471,15 @@ This, because otherwise the remainder of as SQL queries. .PP Another, easier method to have the client read the file content is as -follows. +follows: +.PP +mclient \-d $db \-s \(dqCOPY INTO $table FROM '$file' ON CLIENT USING DELIMITERS ',',E'\e\en',\e\(dq'\(dq .PP -mclient \-d $db \-s \(dqCOPY INTO $table FROM '$file' ON CLIENT USING DELIMITERS ',','\e\en',\e\(dq'\(dq -.PP +In this case the value of +.I $file +can be a path name relative to the directory in which +.I mclient +was started. If, in addition, the option .B \-\-allow\-remote is passed to @@ -482,7 +487,9 @@ is passed to the .I $file in the above query can also be a URL. It then has to have the form -.IB schema :// string . +.IB schema :// string , +.IR e . g ., +.IR https://www.example.org/dumpdata.csv . .PP See https://www.monetdb.org/Documentation/Manuals/SQLreference/CopyInto for more information about the COPY INTO query. diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c --- a/clients/mapilib/mapi.c +++ b/clients/mapilib/mapi.c @@ -2696,6 +2696,7 @@ mapi_reconnect(Mapi mid) hash = malloc(len); if (hash == NULL) { close_connection(mid); + free(pwh); return mapi_setError(mid, "malloc failure", "mapi_reconnect", MERROR); } snprintf(hash, len, "{%s}%s", *algs, pwh); diff --git a/clients/odbc/driver/SQLPrepare.c b/clients/odbc/driver/SQLPrepare.c --- a/clients/odbc/driver/SQLPrepare.c +++ b/clients/odbc/driver/SQLPrepare.c @@ -135,7 +135,11 @@ MNDBPrepare(ODBCStmt *stmt, int concise_type; int length, scale; - mapi_fetch_row(hdl); + if (mapi_fetch_row(hdl) == 0) { + /* Memory allocation error (or maybe something else) */ + addStmtError(stmt, "HY001", 0, 0); + return SQL_ERROR; + } if (ncols == 3 || (s = mapi_fetch_field(hdl, 5)) == NULL) { /* either old prepare (i.e. old server) or no diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c --- a/common/utils/msabaoth.c +++ b/common/utils/msabaoth.c @@ -41,9 +41,9 @@ #endif /** the directory where the databases are (aka dbfarm) */ -char *_sabaoth_internal_dbfarm = NULL; +static char *_sabaoth_internal_dbfarm = NULL; /** the database which is "active" */ -char *_sabaoth_internal_dbname = NULL; +static char *_sabaoth_internal_dbname = NULL; /** identifier of the current process */ static char *_sabaoth_internal_uuid = NULL; @@ -119,6 +119,16 @@ msab_isuuid(const char *restrict s) return hyphens == 4; } +void +msab_dbnameinit(const char *dbname) +{ + if (dbname == NULL) { _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list