Changeset: 170de76f8f26 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=170de76f8f26 Modified Files: clients/Tests/MAL-signatures.stable.out clients/Tests/MAL-signatures.stable.out.int128 clients/Tests/exports.stable.out clients/mapiclient/mclient.c clients/mapiclient/mhelp.c gdk/gdk_calc.c monetdb5/ChangeLog monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows monetdb5/mal/Tests/tst1502.malC monetdb5/mal/Tests/tst233.malC monetdb5/mal/Tests/tst234.malC monetdb5/mal/Tests/tst235.malC monetdb5/mal/Tests/tst903.malC monetdb5/mal/Tests/tst903.stable.out monetdb5/modules/atoms/Tests/xml10.malC monetdb5/modules/kernel/Tests/select.malC monetdb5/modules/kernel/Tests/time01.malC monetdb5/modules/kernel/algebra.c monetdb5/modules/kernel/algebra.h monetdb5/modules/kernel/algebra.mal monetdb5/modules/mal/Tests/inspect05.malC monetdb5/modules/mal/Tests/orderidx00.malC monetdb5/modules/mal/Tests/orderidx04.malC monetdb5/modules/mal/Tests/pqueue.malC monetdb5/modules/mal/Tests/pqueue2.malC monetdb5/modules/mal/Tests/pqueue3.malC monetdb5/optimizer/Tests/DCexample2.malC monetdb5/optimizer/Tests/reorder00.malC monetdb5/optimizer/Tests/reorder00.stable.out monetdb5/optimizer/Tests/tst4700.malC sql/ChangeLog sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_statement.c sql/backends/monet5/sql_statement.h sql/include/sql_catalog.h sql/include/sql_relation.h sql/scripts/75_storagemodel.sql sql/server/rel_dump.c sql/server/rel_sequence.c sql/server/sql_parser.y sql/server/sql_scan.c sql/storage/store.c sql/test/BugTracker-2009/Tests/copy_multiple_files.SF-2902320.stable.out.Windows sql/test/BugTracker-2010/Tests/LIMIT_OFFSET_big-endian.Bug-2622.stable.out sql/test/BugTracker-2013/Tests/create_table_with_func.Bug-3286.sql sql/test/BugTracker-2013/Tests/create_table_with_func.Bug-3286.stable.out sql/test/BugTracker-2015/Tests/alter-table.Bug-3828-part1.stable.out sql/test/BugTracker-2016/Tests/assert-on-push-project-up.Bug-6077.stable.out sql/test/BugTracker-2016/Tests/storagemodel.sql sql/test/BugTracker-2016/Tests/storagemodel.stable.out sql/test/BugTracker-2017/Tests/crash_correlated_subqueries_in_select.Bug-6254.stable.out sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6423.stable.out sql/test/BugTracker-2018/Tests/groupby_having_orderby_count.Bug-6624.stable.out sql/test/Dependencies/Tests/Dependencies.stable.out sql/test/Dependencies/Tests/Dependencies.stable.out.int128 sql/test/Dependencies/Tests/dependency_loop.stable.out sql/test/Dependencies/Tests/dependency_loop.stable.out.int128 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/systemfunctions.stable.out sql/test/Tests/systemfunctions.stable.out.int128 sql/test/emptydb/Tests/check.stable.out sql/test/emptydb/Tests/check.stable.out.32bit sql/test/emptydb/Tests/check.stable.out.int128 sql/test/mergetables/Tests/sqlsmith-apply-outer-join-or.sql sql/test/orderidx/Tests/simpletable.stable.out sql/test/orderidx/Tests/simpletable.stable.out.32bit sql/test/orderidx/Tests/smalltable.stable.out sql/test/orderidx/Tests/smalltable.stable.out.32bit sql/test/pg_regress/Tests/vacuum.stable.out sql/test/pg_regress/Tests/without_oid.stable.out sql/test/pg_regress/Tests/without_oid.stable.out.32bit sql/test/sys-schema/Tests/check_ForeignKey_referential_integrity.sql sql/test/sys-schema/Tests/check_ForeignKey_referential_integrity.stable.out sql/test/sys-schema/Tests/check_PrimaryKey_uniqueness.stable.out Branch: analytics Log Message:
Merge with default. diffs (truncated from 6349 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 @@ -527,12 +527,12 @@ Ready. [ "algebra", "exist", "command algebra.exist(b:bat[:any_1], val:any_1):bit ", "ALGexist;", "Returns whether 'val' occurs in b." ] [ "algebra", "fetch", "command algebra.fetch(b:bat[:any_1], x:oid):any_1 ", "ALGfetchoid;", "Returns the value of the BUN at x-th position with 0 <= x < b.count" ] [ "algebra", "find", "command algebra.find(b:bat[:any_1], t:any_1):oid ", "ALGfind;", "Returns the index position of a value. If no such BUN exists return OID-nil." ] -[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], n:lng, asc:bit, distinct:bit) (X_0:bat[:oid], X_1:bat[:oid]) ", "ALGfirstn;", "Calculate first N values of B" ] -[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], n:lng, asc:bit, distinct:bit):bat[:oid] ", "ALGfirstn;", "Calculate first N values of B" ] -[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], s:bat[:oid], g:bat[:oid], n:lng, asc:bit, distinct:bit) (X_0:bat[:oid], X_1:bat[:oid]) ", "ALGfirstn;", "Calculate first N values of B with candidate list S" ] -[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], s:bat[:oid], g:bat[:oid], n:lng, asc:bit, distinct:bit):bat[:oid] ", "ALGfirstn;", "Calculate first N values of B with candidate list S" ] -[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], s:bat[:oid], n:lng, asc:bit, distinct:bit) (X_0:bat[:oid], X_1:bat[:oid]) ", "ALGfirstn;", "Calculate first N values of B with candidate list S" ] -[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], s:bat[:oid], n:lng, asc:bit, distinct:bit):bat[:oid] ", "ALGfirstn;", "Calculate first N values of B with candidate list S" ] +[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], n:lng, asc:bit, nilslast:bit, distinct:bit) (X_0:bat[:oid], X_1:bat[:oid]) ", "ALGfirstn;", "Calculate first N values of B" ] +[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], n:lng, asc:bit, nilslast:bit, distinct:bit):bat[:oid] ", "ALGfirstn;", "Calculate first N values of B" ] +[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], s:bat[:oid], g:bat[:oid], n:lng, asc:bit, nilslast:bit, distinct:bit) (X_0:bat[:oid], X_1:bat[:oid]) ", "ALGfirstn;", "Calculate first N values of B with candidate list S" ] +[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], s:bat[:oid], g:bat[:oid], n:lng, asc:bit, nilslast:bit, distinct:bit):bat[:oid] ", "ALGfirstn;", "Calculate first N values of B with candidate list S" ] +[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], s:bat[:oid], n:lng, asc:bit, nilslast:bit, distinct:bit) (X_0:bat[:oid], X_1:bat[:oid]) ", "ALGfirstn;", "Calculate first N values of B with candidate list S" ] +[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], s:bat[:oid], n:lng, asc:bit, nilslast:bit, distinct:bit):bat[:oid] ", "ALGfirstn;", "Calculate first N values of B with candidate list S" ] [ "algebra", "groupby", "command algebra.groupby(gids:bat[:oid], cnts:bat[:lng]):bat[:oid] ", "ALGgroupby;", "Produces a new BAT with groups identified by the head column. The result contains tail times the head value, ie the tail contains the result group sizes." ] [ "algebra", "ilike", "command algebra.ilike(s:str, pat:str):bit ", "PCREilike2;", "" ] [ "algebra", "ilike", "command algebra.ilike(s:str, pat:str, esc:str):bit ", "PCREilike3;", "" ] @@ -569,15 +569,15 @@ Ready. [ "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, 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, 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, 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, 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, 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, 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, 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, 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, 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 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", "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." ] 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 @@ -631,12 +631,12 @@ Ready. [ "algebra", "exist", "command algebra.exist(b:bat[:any_1], val:any_1):bit ", "ALGexist;", "Returns whether 'val' occurs in b." ] [ "algebra", "fetch", "command algebra.fetch(b:bat[:any_1], x:oid):any_1 ", "ALGfetchoid;", "Returns the value of the BUN at x-th position with 0 <= x < b.count" ] [ "algebra", "find", "command algebra.find(b:bat[:any_1], t:any_1):oid ", "ALGfind;", "Returns the index position of a value. If no such BUN exists return OID-nil." ] -[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], n:lng, asc:bit, distinct:bit) (X_0:bat[:oid], X_1:bat[:oid]) ", "ALGfirstn;", "Calculate first N values of B" ] -[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], n:lng, asc:bit, distinct:bit):bat[:oid] ", "ALGfirstn;", "Calculate first N values of B" ] -[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], s:bat[:oid], g:bat[:oid], n:lng, asc:bit, distinct:bit) (X_0:bat[:oid], X_1:bat[:oid]) ", "ALGfirstn;", "Calculate first N values of B with candidate list S" ] -[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], s:bat[:oid], g:bat[:oid], n:lng, asc:bit, distinct:bit):bat[:oid] ", "ALGfirstn;", "Calculate first N values of B with candidate list S" ] -[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], s:bat[:oid], n:lng, asc:bit, distinct:bit) (X_0:bat[:oid], X_1:bat[:oid]) ", "ALGfirstn;", "Calculate first N values of B with candidate list S" ] -[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], s:bat[:oid], n:lng, asc:bit, distinct:bit):bat[:oid] ", "ALGfirstn;", "Calculate first N values of B with candidate list S" ] +[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], n:lng, asc:bit, nilslast:bit, distinct:bit) (X_0:bat[:oid], X_1:bat[:oid]) ", "ALGfirstn;", "Calculate first N values of B" ] +[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], n:lng, asc:bit, nilslast:bit, distinct:bit):bat[:oid] ", "ALGfirstn;", "Calculate first N values of B" ] +[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], s:bat[:oid], g:bat[:oid], n:lng, asc:bit, nilslast:bit, distinct:bit) (X_0:bat[:oid], X_1:bat[:oid]) ", "ALGfirstn;", "Calculate first N values of B with candidate list S" ] +[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], s:bat[:oid], g:bat[:oid], n:lng, asc:bit, nilslast:bit, distinct:bit):bat[:oid] ", "ALGfirstn;", "Calculate first N values of B with candidate list S" ] +[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], s:bat[:oid], n:lng, asc:bit, nilslast:bit, distinct:bit) (X_0:bat[:oid], X_1:bat[:oid]) ", "ALGfirstn;", "Calculate first N values of B with candidate list S" ] +[ "algebra", "firstn", "pattern algebra.firstn(b:bat[:any], s:bat[:oid], n:lng, asc:bit, nilslast:bit, distinct:bit):bat[:oid] ", "ALGfirstn;", "Calculate first N values of B with candidate list S" ] [ "algebra", "groupby", "command algebra.groupby(gids:bat[:oid], cnts:bat[:lng]):bat[:oid] ", "ALGgroupby;", "Produces a new BAT with groups identified by the head column. The result contains tail times the head value, ie the tail contains the result group sizes." ] [ "algebra", "ilike", "command algebra.ilike(s:str, pat:str):bit ", "PCREilike2;", "" ] [ "algebra", "ilike", "command algebra.ilike(s:str, pat:str, esc:str):bit ", "PCREilike3;", "" ] @@ -673,15 +673,15 @@ Ready. [ "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, 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, 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, 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, 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, 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, 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, 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, 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, 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 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", "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." ] 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 @@ -740,15 +740,15 @@ str ALGslice(bat *ret, const bat *bid, c str ALGslice_int(bat *ret, const bat *bid, const int *start, const int *end); str ALGslice_lng(bat *ret, const bat *bid, const lng *start, const lng *end); str ALGslice_oid(bat *ret, const bat *bid, const oid *start, const oid *end); -str ALGsort11(bat *result, const bat *bid, const bit *reverse, const bit *stable); -str ALGsort12(bat *result, bat *norder, const bat *bid, const bit *reverse, const bit *stable); -str ALGsort13(bat *result, bat *norder, bat *ngroup, const bat *bid, const bit *reverse, const bit *stable); -str ALGsort21(bat *result, const bat *bid, const bat *order, const bit *reverse, const bit *stable); -str ALGsort22(bat *result, bat *norder, const bat *bid, const bat *order, const bit *reverse, const bit *stable); -str ALGsort23(bat *result, bat *norder, bat *ngroup, const bat *bid, const bat *order, const bit *reverse, const bit *stable); -str ALGsort31(bat *result, const bat *bid, const bat *order, const bat *group, const bit *reverse, const bit *stable); -str ALGsort32(bat *result, bat *norder, const bat *bid, const bat *order, const bat *group, const bit *reverse, const bit *stable); -str ALGsort33(bat *result, bat *norder, bat *ngroup, const bat *bid, const bat *order, const bat *group, const bit *reverse, const bit *stable); +str ALGsort11(bat *result, const bat *bid, const bit *reverse, const bit *nilslast, const bit *stable); +str ALGsort12(bat *result, bat *norder, const bat *bid, const bit *reverse, const bit *nilslast, const bit *stable); +str ALGsort13(bat *result, bat *norder, bat *ngroup, const bat *bid, const bit *reverse, const bit *nilslast, const bit *stable); +str ALGsort21(bat *result, const bat *bid, const bat *order, const bit *reverse, const bit *nilslast, const bit *stable); +str ALGsort22(bat *result, bat *norder, const bat *bid, const bat *order, const bit *reverse, const bit *nilslast, const bit *stable); +str ALGsort23(bat *result, bat *norder, bat *ngroup, const bat *bid, const bat *order, const bit *reverse, const bit *nilslast, const bit *stable); +str ALGsort31(bat *result, const bat *bid, const bat *order, const bat *group, const bit *reverse, const bit *nilslast, const bit *stable); +str ALGsort32(bat *result, bat *norder, const bat *bid, const bat *order, const bat *group, const bit *reverse, const bit *nilslast, const bit *stable); +str ALGsort33(bat *result, bat *norder, bat *ngroup, const bat *bid, const bat *order, const bat *group, const bit *reverse, const bit *nilslast, const bit *stable); str ALGstdev(dbl *res, const bat *bid); str ALGstdevp(dbl *res, const bat *bid); str ALGsubslice_lng(bat *ret, const bat *bid, const lng *start, const lng *end); diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -3723,5 +3723,8 @@ main(int argc, char **argv) mapi_destroy(mid); mnstr_destroy(stdout_stream); mnstr_destroy(stderr_stream); + if (priv.buf != NULL) + free(priv.buf); + return c; } diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c --- a/clients/mapiclient/mhelp.c +++ b/clients/mapiclient/mhelp.c @@ -402,7 +402,7 @@ SQLhelp sqlhelp[] = { "[ GROUP BY grouping_element ',', ...] ]\n" "[ HAVING condition [',' ...] ]\n" "[ { UNION | INTERSECT | EXCEPT } [ ALL | DISTINCT ] [ CORRESPONDING ] select ]\n" - "[ ORDER BY expression [ ASC | DESC ] [',' ...] ]\n" + "[ ORDER BY expression [ ASC | DESC ] [ NULLS { FIRST | LAST } ] [',' ...] ]\n" "[ LIMIT { count | param } ]\n" "[ OFFSET { count | param } ]\n" "[ SAMPLE size ]", diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c --- a/gdk/gdk_calc.c +++ b/gdk/gdk_calc.c @@ -13686,11 +13686,14 @@ convert_any_str(BAT *b, BAT *bn, BUN cnt end = i + 1; } src = BUNtvar(bi, i); - if ((*atomtostr)(&dst, &len, src) < 0) - goto bunins_failed; - if ((*atomcmp)(src, nil) == 0) + if ((*atomcmp)(src, nil) == 0) { nils++; - tfastins_nocheckVAR(bn, i, dst, bn->twidth); + tfastins_nocheckVAR(bn, i, str_nil, bn->twidth); + } else { + if ((*atomtostr)(&dst, &len, src) < 0) + goto bunins_failed; + tfastins_nocheckVAR(bn, i, dst, bn->twidth); + } } } else { size_t size = ATOMsize(tp); @@ -13707,11 +13710,14 @@ convert_any_str(BAT *b, BAT *bn, BUN cnt if (++cand == candend) end = i + 1; } - if ((*atomtostr)(&dst, &len, src) < 0) - goto bunins_failed; - if ((*atomcmp)(src, nil) == 0) + if ((*atomcmp)(src, nil) == 0) { nils++; - tfastins_nocheckVAR(bn, i, dst, bn->twidth); + tfastins_nocheckVAR(bn, i, str_nil, bn->twidth); + } else { + if ((*atomtostr)(&dst, &len, src) < 0) + goto bunins_failed; + tfastins_nocheckVAR(bn, i, dst, bn->twidth); + } src = (const void *) ((const char *) src + size); } } @@ -13836,7 +13842,7 @@ convert_void_any(oid seq, BUN cnt, BAT * ((bte *) dst)[i] = 1; } } else { - for (i = 0; i < end; i++, seq++) { + for (i = start; i < end; i++, seq++) { CHECKCAND((bte *) dst, i, candoff, bte_nil); ((bte *) dst)[i] = (bte) seq; @@ -13890,7 +13896,7 @@ convert_void_any(oid seq, BUN cnt, BAT * case TYPE_str: for (i = 0; i < start; i++) tfastins_nocheckVAR(bn, i, str_nil, bn->twidth); - for (i = 0; i < end; i++) { + for (; i < end; i++) { if (cand) { if (i < *cand - candoff) { nils++; @@ -13945,12 +13951,8 @@ convert_void_any(oid seq, BUN cnt, BAT * ((dbl *) dst)[i] = dbl_nil; break; case TYPE_str: - seq = oid_nil; - if ((*atomtostr)(&s, &len, &seq) < 0) - goto bunins_failed; - for (; i < cnt; i++) { - tfastins_nocheckVAR(bn, i, s, bn->twidth); - } + for (; i < cnt; i++) + tfastins_nocheckVAR(bn, i, str_nil, bn->twidth); break; default: return BUN_NONE + 1; diff --git a/monetdb5/ChangeLog b/monetdb5/ChangeLog --- a/monetdb5/ChangeLog +++ b/monetdb5/ChangeLog @@ -1,3 +1,11 @@ # ChangeLog file for MonetDB5 # This file is updated with Maddlog +* Thu Nov 8 2018 Sjoerd Mullender <sjo...@acm.org> +- The MAL functions algebra.sort and algebra.firstn now have a new, + extra second-to-last argument, nilslast:bit, which indicates where + NIL values are to be sorted: at the beginning, or at the end. The old + behavior is when for algebra.sort, the value of nilslast is equal to + the value or the reverse:bit parameter, for algebra.firstn when the + value of nilslast is opposite to the value of the asc:bit parameter. + diff --git a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows --- a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows +++ b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows @@ -71,16 +71,16 @@ Ready. % .explain # table_name % mal # name % clob # type -% 177 # length +% 184 # length function user.s10_1():void; - X_1:void := querylog.define("explain copy into ttt from \\'a:\\\\tmp/xyz\\';":str, "sequential_pipe":str, 21:int); + X_1:void := querylog.define("explain copy into ttt from \\'a:\\\\tmp/xyz\\';":str, "sequential_pipe":str, 22:int); X_4:int := sql.mvc(); - (X_25:bat[:int], X_26:bat[:int], X_27:bat[:int]) := sql.copy_from(nil:ptr, "|":str, "\\n":str, nil:str, "null":str, "a:\\tmp/xyz":str, -1:lng, 0:lng, 0:int, 0:int, nil:str); - X_29:int := sql.append(X_4:int, "sys":str, "ttt":str, "a":str, X_25:bat[:int]); - X_34:int := sql.append(X_29:int, "sys":str, "ttt":str, "b":str, X_26:bat[:int]); - X_37:int := sql.append(X_34:int, "sys":str, "ttt":str, "c":str, X_27:bat[:int]); - X_39:lng := aggr.count(X_27:bat[:int]); - sql.affectedRows(X_37:int, X_39:lng); + (X_26:bat[:int], X_27:bat[:int], X_28:bat[:int]) := sql.copy_from(nil:ptr, "|":str, "\\n":str, nil:str, "null":str, "a:\\tmp/xyz":str, -1:lng, 0:lng, 0:int, 0:int, nil:str, 0:int); + X_30:int := sql.append(X_4:int, "sys":str, "ttt":str, "a":str, X_26:bat[:int]); + X_35:int := sql.append(X_30:int, "sys":str, "ttt":str, "b":str, X_27:bat[:int]); + X_38:int := sql.append(X_35:int, "sys":str, "ttt":str, "c":str, X_28:bat[:int]); + X_40:lng := aggr.count(X_28:bat[:int]); + sql.affectedRows(X_38:int, X_40:lng); end user.s10_1; #inline actions= 0 time=1 usec #remap actions= 0 time=2 usec @@ -126,16 +126,16 @@ end user.s10_1; % .explain # table_name % mal # name % clob # type -% 176 # length +% 183 # length function user.s26_1():void; - X_1:void := querylog.define("explain copy into ttt from \\'Z:/tmp/xyz\\';":str, "user_1":str, 21:int); + X_1:void := querylog.define("explain copy into ttt from \\'Z:/tmp/xyz\\';":str, "user_1":str, 22:int); X_4:int := sql.mvc(); - (X_25:bat[:int], X_26:bat[:int], X_27:bat[:int]) := sql.copy_from(nil:ptr, "|":str, "\\n":str, nil:str, "null":str, "Z:/tmp/xyz":str, -1:lng, 0:lng, 0:int, 0:int, nil:str); - X_29:int := sql.append(X_4:int, "sys":str, "ttt":str, "a":str, X_25:bat[:int]); - X_34:int := sql.append(X_29:int, "sys":str, "ttt":str, "b":str, X_26:bat[:int]); - X_39:lng := aggr.count(X_27:bat[:int]); - X_37:int := sql.append(X_34:int, "sys":str, "ttt":str, "c":str, X_27:bat[:int]); - sql.affectedRows(X_37:int, X_39:lng); + (X_26:bat[:int], X_27:bat[:int], X_28:bat[:int]) := sql.copy_from(nil:ptr, "|":str, "\\n":str, nil:str, "null":str, "Z:/tmp/xyz":str, -1:lng, 0:lng, 0:int, 0:int, nil:str, 0:int); + X_30:int := sql.append(X_4:int, "sys":str, "ttt":str, "a":str, X_26:bat[:int]); + X_35:int := sql.append(X_30:int, "sys":str, "ttt":str, "b":str, X_27:bat[:int]); + X_40:lng := aggr.count(X_28:bat[:int]); + X_38:int := sql.append(X_35:int, "sys":str, "ttt":str, "c":str, X_28:bat[:int]); + sql.affectedRows(X_38:int, X_40:lng); end user.s26_1; #inline actions= 0 time=0 usec #remap actions= 0 time=2 usec diff --git a/monetdb5/mal/Tests/tst1502.malC b/monetdb5/mal/Tests/tst1502.malC --- a/monetdb5/mal/Tests/tst1502.malC +++ b/monetdb5/mal/Tests/tst1502.malC @@ -36,9 +36,9 @@ bat.append(z,"c"); bat.append(z,"a"); io.print("sort x"); - xs:=algebra.sort(x,false:bit,false:bit); + xs:=algebra.sort(x,false:bit,false:bit,false:bit); io.print(xs); io.print("hsort xrev"); - xrev:=algebra.sort(x,true:bit,false:bit); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list