MonetDB: default - Remove system function sys.environment(). It ...
Changeset: d39ac09b921a for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d39ac09b921a Modified Files: geom/sql/40_geom.sql sql/ChangeLog sql/backends/monet5/sql_upgrades.c sql/scripts/25_debug.sql sql/test/BugTracker-2016/Tests/assert-on-project.Bug-6078.stable.out sql/test/BugTracker-2016/Tests/storagemodel.stable.out sql/test/BugTracker-2017/Tests/create_view_order_by.Bug-3465.stable.out sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6449.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/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/sys-schema/Tests/check_PrimaryKey_uniqueness.stable.out Branch: default Log Message: Remove system function sys.environment(). It is a duplicate of system function sys.env(). Before we can drop function sys.environment() we need to drop view sys.environment which uses sys.environment(). Before we can drop view sys.environment we need to drop view sys.geometry_columns which uses sys.environment. Both views sys.geometry_columns and sys.environment are redefined and recreated. diffs (truncated from 746 to 300 lines): diff --git a/geom/sql/40_geom.sql b/geom/sql/40_geom.sql --- a/geom/sql/40_geom.sql +++ b/geom/sql/40_geom.sql @@ -5,7 +5,6 @@ -- Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V. -- make sure you load the geom module before loading this sql module --- create spatial_ref_sys metadata table CREATE FUNCTION Has_Z(info integer) RETURNS integer EXTERNAL NAME geom."hasZ"; GRANT EXECUTE ON FUNCTION Has_Z(integer) TO PUBLIC; @@ -15,7 +14,8 @@ CREATE FUNCTION get_type(info integer, f GRANT EXECUTE ON FUNCTION get_type(integer, integer) TO PUBLIC; - +-- create spatial_ref_sys metadata table +-- ref: https://postgis.net/docs/using_postgis_dbmanagement.html#spatial_ref_sys CREATE TABLE spatial_ref_sys ( srid INTEGER NOT NULL PRIMARY KEY, auth_name VARCHAR (256), @@ -26,25 +26,20 @@ CREATE TABLE spatial_ref_sys ( GRANT SELECT ON spatial_ref_sys TO PUBLIC; -- create geometry_columns metadata view -create view geometry_columns as - select e.value as f_table_catalog, +-- ref: https://postgis.net/docs/using_postgis_dbmanagement.html#geometry_columns +create view sys.geometry_columns as + select cast(null as varchar(1)) as f_table_catalog, s.name as f_table_schema, - y.f_table_name, y.f_geometry_column, y.coord_dimension, y.srid, y.type - from schemas s, environment e, ( - select t.schema_id, - t.name as f_table_name, - x.name as f_geometry_column, - cast(has_z(info)+has_m(info)+2 as integer) as coord_dimension, - srid, get_type(info, 0) as type - from tables t, ( - select name, table_id, type_digits AS info, type_scale AS srid - from columns - where type in ( select distinct sqlname from types where systemname='wkb') - ) as x - where t.id=x.table_id - ) y - where y.schema_id=s.id and e.name='gdk_dbname'; -GRANT SELECT ON geometry_columns TO PUBLIC; + t.name as f_table_name, + c.name as f_geometry_column, + cast(has_z(c.type_digits) + has_m(c.type_digits) +2 as integer) as coord_dimension, + c.type_scale as srid, + get_type(c.type_digits, 0) as type + from sys.columns c, sys.tables t, sys.schemas s + where c.table_id = t.id and t.schema_id = s.id + and c.type in (select sqlname from sys.types where systemname in ('wkb', 'wkba')); + +GRANT SELECT ON sys.geometry_columns TO PUBLIC; copy 3911 records into spatial_ref_sys from stdin using delimiters '|'; diff --git a/sql/ChangeLog b/sql/ChangeLog --- a/sql/ChangeLog +++ b/sql/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog file for sql # This file is updated with Maddlog +* Thu Dec 7 2017 Martin van Dinther +- Removed system function sys.environment(). It was a duplicate of system + function sys.env(). + * Thu Nov 9 2017 Martin van Dinther - Implemented behavior for DROP SCHEMA my_schema RESTRICT command. Previously the RESTRICT keyword was accepted but not obeyed. It would diff --git a/sql/backends/monet5/sql_upgrades.c b/sql/backends/monet5/sql_upgrades.c --- a/sql/backends/monet5/sql_upgrades.c +++ b/sql/backends/monet5/sql_upgrades.c @@ -906,8 +906,8 @@ sql_updat
MonetDB: jitudf - Close branch after merge with default.
Changeset: e0d0579c6b97 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e0d0579c6b97 Branch: jitudf Log Message: Close branch after merge with default. ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Merge with jitudf.
Changeset: 0665312ee4d1 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0665312ee4d1 Added Files: sql/backends/monet5/UDF/capi/50_capi.mal sql/backends/monet5/UDF/capi/Makefile.ag sql/backends/monet5/UDF/capi/Tests/All sql/backends/monet5/UDF/capi/Tests/capi00.sql sql/backends/monet5/UDF/capi/Tests/capi00.stable.err sql/backends/monet5/UDF/capi/Tests/capi00.stable.out sql/backends/monet5/UDF/capi/Tests/capi01.sql sql/backends/monet5/UDF/capi/Tests/capi01.stable.err sql/backends/monet5/UDF/capi/Tests/capi01.stable.out sql/backends/monet5/UDF/capi/Tests/capi02.sql sql/backends/monet5/UDF/capi/Tests/capi02.stable.err sql/backends/monet5/UDF/capi/Tests/capi02.stable.out sql/backends/monet5/UDF/capi/Tests/capi03.sql sql/backends/monet5/UDF/capi/Tests/capi03.stable.err sql/backends/monet5/UDF/capi/Tests/capi03.stable.out sql/backends/monet5/UDF/capi/Tests/capi04.sql sql/backends/monet5/UDF/capi/Tests/capi04.stable.err sql/backends/monet5/UDF/capi/Tests/capi04.stable.out sql/backends/monet5/UDF/capi/Tests/capi05.sql sql/backends/monet5/UDF/capi/Tests/capi05.stable.err sql/backends/monet5/UDF/capi/Tests/capi05.stable.out sql/backends/monet5/UDF/capi/Tests/capi06.sql sql/backends/monet5/UDF/capi/Tests/capi06.stable.err sql/backends/monet5/UDF/capi/Tests/capi06.stable.out sql/backends/monet5/UDF/capi/Tests/capi07.sql sql/backends/monet5/UDF/capi/Tests/capi07.stable.err sql/backends/monet5/UDF/capi/Tests/capi07.stable.out sql/backends/monet5/UDF/capi/Tests/capi08.sql sql/backends/monet5/UDF/capi/Tests/capi08.stable.err sql/backends/monet5/UDF/capi/Tests/capi08.stable.out sql/backends/monet5/UDF/capi/Tests/capi09.sql sql/backends/monet5/UDF/capi/Tests/capi09.stable.err sql/backends/monet5/UDF/capi/Tests/capi09.stable.out sql/backends/monet5/UDF/capi/Tests/capi10.sql sql/backends/monet5/UDF/capi/Tests/capi10.stable.err sql/backends/monet5/UDF/capi/Tests/capi10.stable.out sql/backends/monet5/UDF/capi/Tests/capi11.sql sql/backends/monet5/UDF/capi/Tests/capi11.stable.err sql/backends/monet5/UDF/capi/Tests/capi11.stable.out sql/backends/monet5/UDF/capi/Tests/capi12.sql sql/backends/monet5/UDF/capi/Tests/capi12.stable.err sql/backends/monet5/UDF/capi/Tests/capi12.stable.out sql/backends/monet5/UDF/capi/Tests/capi13.sql sql/backends/monet5/UDF/capi/Tests/capi13.stable.err sql/backends/monet5/UDF/capi/Tests/capi13.stable.out sql/backends/monet5/UDF/capi/capi.c sql/backends/monet5/UDF/capi/capi.h sql/backends/monet5/UDF/capi/capi.mal sql/backends/monet5/UDF/capi/cheader.h sql/backends/monet5/UDF/udf/80_udf.mal sql/backends/monet5/UDF/udf/80_udf.sql sql/backends/monet5/UDF/udf/80_udf_hge.mal sql/backends/monet5/UDF/udf/80_udf_hge.sql sql/backends/monet5/UDF/udf/Makefile.ag sql/backends/monet5/UDF/udf/README sql/backends/monet5/UDF/udf/Tests/All sql/backends/monet5/UDF/udf/Tests/udf-fuse.sql sql/backends/monet5/UDF/udf/Tests/udf-fuse.stable.err sql/backends/monet5/UDF/udf/Tests/udf-fuse.stable.out sql/backends/monet5/UDF/udf/Tests/udf-reverse.sql sql/backends/monet5/UDF/udf/Tests/udf-reverse.stable.err sql/backends/monet5/UDF/udf/Tests/udf-reverse.stable.out sql/backends/monet5/UDF/udf/udf.c sql/backends/monet5/UDF/udf/udf.h sql/backends/monet5/UDF/udf/udf.mal sql/backends/monet5/UDF/udf/udf_hge.mal sql/backends/monet5/UDF/udf/udf_impl.h Removed Files: sql/backends/monet5/UDF/cudf/80_udf.mal sql/backends/monet5/UDF/cudf/80_udf.sql sql/backends/monet5/UDF/cudf/80_udf_hge.mal sql/backends/monet5/UDF/cudf/80_udf_hge.sql sql/backends/monet5/UDF/cudf/Makefile.ag sql/backends/monet5/UDF/cudf/README sql/backends/monet5/UDF/cudf/Tests/All sql/backends/monet5/UDF/cudf/Tests/udf-fuse.sql sql/backends/monet5/UDF/cudf/Tests/udf-fuse.stable.err sql/backends/monet5/UDF/cudf/Tests/udf-fuse.stable.out sql/backends/monet5/UDF/cudf/Tests/udf-reverse.sql sql/backends/monet5/UDF/cudf/Tests/udf-reverse.stable.err sql/backends/monet5/UDF/cudf/Tests/udf-reverse.stable.out sql/backends/monet5/UDF/cudf/udf.c sql/backends/monet5/UDF/cudf/udf.h sql/backends/monet5/UDF/cudf/udf.mal sql/backends/monet5/UDF/cudf/udf_hge.mal sql/backends/monet5/UDF/cudf/udf_impl.h Modified Files: .hgignore buildtools/autogen/autogen.py clients/Tests/exports.stable.out gdk/gdk.h gdk/gdk_bbp.c gdk/gdk_utils.c gdk/gdk_utils.h
MonetDB: jitudf - Merge with default.
Changeset: 584074062c90 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=584074062c90 Added Files: sql/backends/monet5/Tests/pyloader06.stable.out.32bit sql/backends/monet5/Tests/pyloader07.stable.out.32bit sql/test/BugTracker-2017/Tests/groupby_assertion.Bug-6338.stable.err sql/test/BugTracker-2017/Tests/groupby_assertion.Bug-6338.stable.out sql/test/BugTracker-2017/Tests/parsererror.Bug-6381.stable.err sql/test/BugTracker-2017/Tests/parsererror.Bug-6381.stable.out Modified Files: clients/Tests/mclient-uri.SQL.sh clients/mapiclient/Tests/mclient--help.stable.err clients/mapiclient/mclient.1 clients/mapiclient/mclient.c gdk/gdk_aggr.c monetdb5/optimizer/Tests/manifold2.stable.out.single sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out sql/benchmarks/tpch/LOCKED/Tests/12.stable.out sql/benchmarks/tpch/LOCKED/Tests/16.stable.out sql/benchmarks/tpch/LOCKED/Tests/18.stable.out sql/benchmarks/tpch/LOCKED/Tests/19.stable.out sql/benchmarks/tpch/LOCKED/Tests/22.stable.out sql/benchmarks/tpch/Tests/01-22.stable.out sql/benchmarks/tpch/Tests/12.stable.out sql/benchmarks/tpch/Tests/16.stable.out sql/benchmarks/tpch/Tests/18.stable.out sql/benchmarks/tpch/Tests/19.stable.out sql/benchmarks/tpch/Tests/22.stable.out sql/server/rel_optimizer.c sql/server/rel_select.c sql/server/rel_updates.c sql/test/BugTracker-2017/Tests/cleanup_statistics.Bug-6439.stable.out sql/test/BugTracker-2017/Tests/lateral.Bug-6310.stable.err sql/test/BugTracker-2017/Tests/lateral.Bug-6310.stable.out sql/test/BugTracker-2017/Tests/parsererror.Bug-6381.sql sql/test/BugTracker-2017/Tests/spurious_error.Bug-6344.stable.out sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6477.stable.err sql/test/emptydb/Tests/check.stable.out.32bit testing/Mtest.py.in Branch: jitudf Log Message: Merge with default. diffs (truncated from 1742 to 300 lines): diff --git a/clients/Tests/mclient-uri.SQL.sh b/clients/Tests/mclient-uri.SQL.sh --- a/clients/Tests/mclient-uri.SQL.sh +++ b/clients/Tests/mclient-uri.SQL.sh @@ -2,8 +2,8 @@ # test the URI parsing capabilities of the MAPI library -Mlog "mclient -d mapi:monetdb://$HOST:$MAPIPORT/$TSTDB?language=sql&user=monetdb -f test -E utf-8 -s select 1" +Mlog "mclient -d mapi:monetdb://$HOST:$MAPIPORT/$TSTDB?language=sql&user=monetdb -f test -t none-E utf-8 -s select 1" mclient -d "mapi:monetdb://$HOST:$MAPIPORT/$TSTDB?language=sql&user=monetdb" -f test -E utf-8 -s 'select 1' -Mlog "mclient -d mapi:monetdb://$MAPIHOST/.s.monetdb.$MAPIPORT?database=$TSTDB&language=sql&user=monetdb -f test -E utf-8 -s select 1" +Mlog "mclient -d mapi:monetdb://$MAPIHOST/.s.monetdb.$MAPIPORT?database=$TSTDB&language=sql&user=monetdb -f test -t none -E utf-8 -s select 1" mclient -d "mapi:monetdb://$MAPIHOST/.s.monetdb.$MAPIPORT?database=$TSTDB&language=sql&user=monetdb" -f test -E utf-8 -s 'select 1' diff --git a/clients/mapiclient/Tests/mclient--help.stable.err b/clients/mapiclient/Tests/mclient--help.stable.err --- a/clients/mapiclient/Tests/mclient--help.stable.err +++ b/clients/mapiclient/Tests/mclient--help.stable.err @@ -19,9 +19,10 @@ Options are: -d database | --database=database database to connect to (may be URI) -e | --echoecho the query -E charset | --encoding=charset specify encoding (character set) of the terminal - -f kind | --format=kind specify output format {csv,tab,raw,sql,xml} + -f kind | --format=kind specify output format {csv,tab,raw,sql,xml,trash} -H | --history load/save cmdline history (default off) - -i | --interactive[=tm] interpret `\' commands on stdin, use time formatting {ms,s,m} + -i | --interactive interpret `\' commands on stdin + -t | --timer=format use time formatting {clock,minutes,seconds,milliseconds,microseconds,none} -l language | --language=lang{sql,mal} -L logfile | --log=logfile save client/server interaction -s stmt | --statement=stmt run single statement diff --git a/clients/mapiclient/mclient.1 b/clients/mapiclient/mclient.1 --- a/clients/mapiclient/mclient.1 +++ b/clients/mapiclient/mclient.1 @@ -148,22 +148,17 @@ these are supported. Specify the portnumber of the server (default: .BR 5 ). .TP -\fB\-\-interactive\fP[\fB=\fP\fItimermode\fP] (\fB\-i\fP[\fItimermode\fP]) +\fB\-\-interactive\fP When reading from standard input, interpret lines starting with .B \e (backslash) specially. See the section BACKSLASH COMMANDS below. -This is the default if standard input is a terminal. -The optional \fItimermode\fP argument controls the -format of the time reported for queries. -Note that no space is allowed between -.B \-i -and -.IR timermode . -The defau
MonetDB: default - Remove the detailed timer control
Changeset: c66c01612f32 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c66c01612f32 Modified Files: clients/mapiclient/mclient.1 clients/mapiclient/mclient.c Branch: default Log Message: Remove the detailed timer control As discussed, limit timer to either (clock, performance, none) diffs (117 lines): diff --git a/clients/mapiclient/mclient.1 b/clients/mapiclient/mclient.1 --- a/clients/mapiclient/mclient.1 +++ b/clients/mapiclient/mclient.1 @@ -155,11 +155,8 @@ When reading from standard input, interp See the section BACKSLASH COMMANDS below. \fB\-\-timer\fP[\fB=\fP\fItimermode\fP] -The \fItimer\fP command controls the -format of the time reported for queries. +The \fItimer\fP command controls the format of the time reported for queries. The default mode is \fBclock\fP which reports on the wall-clock time in a human friendly way. -The precision of the timing can be forced using any of -[ \fBmicroseconds\fP, \fBmilliseconds\fP, \fBseconds\fP and \fBminutes\fP] The timer mode \fBnone\fP turns off timing reporting. The timer mode \fBperformance\fP shows the timing components in millisecond resolution. .TP diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -272,10 +272,6 @@ timerHumanStop(void) static enum itimers { T_CLOCK = 0,// render wallclock time in human readable format - T_MICRO,// render as microseconds - T_MILLIS, // render as milliseconds - T_SECS, - T_MINUTES, T_PERF, // return detailed performance T_NONE // don't render the timing information } timermode = T_CLOCK; @@ -288,10 +284,6 @@ timerHuman(int64_t sqloptimizer, int64_t (void) sqloptimizer; - if (timermode == T_NONE){ - htimbuf[0] = 0; - return htimbuf; - } if (timermode == T_CLOCK){ if( t / 1000 < 950) { snprintf(htimbuf, sizeof(htimbuf), "clk: " TTFMT ".%03d ms" , t / 1000, (int) (t % 1000)); @@ -315,23 +307,7 @@ timerHuman(int64_t sqloptimizer, int64_t querytime /1000, (int)(querytime % 1000)); return(htimbuf); } - /* the scale is not strictly needed because it is part of the command line and simplifies parsing*/ - if (timermode == T_MICRO){ - snprintf(htimbuf, sizeof(htimbuf), TTFMT " mu", t); - return(htimbuf); - } - if (timermode == T_MILLIS ){ - snprintf(htimbuf, sizeof(htimbuf), TTFMT ".%03d ms", t / 1000, (int) (t % 1000)); - return(htimbuf); - } - t /= 1000; - if (timermode == T_SECS ){ - snprintf(htimbuf, sizeof(htimbuf), TTFMT ".%02d sec", t / 1000, (int) ((t % 1000) / 100)); - return(htimbuf); - } - // T_MINUTES - t /= 1000; - snprintf(htimbuf, sizeof(htimbuf), TTFMT ".%02d min",t / 60, (int) (t % 60)); + htimbuf[0] = 0; return(htimbuf); } @@ -2839,31 +2815,12 @@ doFile(Mapi mid, stream *fp, int useinse ; if (*line == 0) { mnstr_printf(toConsole, "Current time formatter: "); - if( timermode == T_MICRO) - mnstr_printf(toConsole,"microseconds\n"); - if( timermode == T_MILLIS) - mnstr_printf(toConsole,"milliseconds\n"); - if( timermode == T_SECS) - mnstr_printf(toConsole,"seconds\n"); - if( timermode == T_MINUTES) - mnstr_printf(toConsole,"minutes\n"); if( timermode == T_PERF) mnstr_printf(toConsole,"performance\n"); if( timermode == T_NONE) mnstr_printf(toConsole,"none\n"); if( timermode == T_CLOCK) mnstr_printf(toConsole,"clock\n"); - } else - if (strncmp(line, "milli", 5) == 0 || strcmp(line,"milliseconds") == 0 ){ - timermode = T_MILLIS; - } else if (strncmp(line, "sec", 3) == 0 || strcmp(line,"seconds") == 0){ -
MonetDB: Jul2017 - Colorize output, even on Windows.
Changeset: 9ca37fbd8e3d for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9ca37fbd8e3d Modified Files: testing/Mtest.py.in Branch: Jul2017 Log Message: Colorize output, even on Windows. On anything older than Windows 10, it can't be done by using escape sequences (and I haven't tested Windows 10), but using console attributes should work anywhere. diffs (122 lines): diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in --- a/testing/Mtest.py.in +++ b/testing/Mtest.py.in @@ -45,15 +45,65 @@ start_time = time.time() # whether output goes to a tty isatty = os.isatty(sys.stdout.fileno()) -if os.name != 'nt' and isatty: -# color output a little -RED = '\033[1;31m' -GREEN = '\033[0;32m' -PURPLE = '\033[1;35m' # actually magenta -BLACK = '\033[0;0m' -else: -# no coloring if not to a tty -RED = GREEN = PURPLE = BLACK = '' +# default is no color (these three functions may get redefined) +def prred(str, write = sys.stdout.write): +write(str) +def prgreen(str, write = sys.stdout.write): +write(str) +def prpurple(str, write = sys.stdout.write): +write(str) +if isatty: +if os.name != 'nt': +# color output a little +RED = '\033[1;31m' +GREEN = '\033[0;32m' +PURPLE = '\033[1;35m' # actually magenta +BLACK = '\033[0;0m' +def prred(str, write = sys.stdout.write): +write(RED) +write(str) +write(BLACK) +def prgreen(str, write = sys.stdout.write): +write(GREEN) +write(str) +write(BLACK) +def prpurple(str, write = sys.stdout.write): +write(PURPLE) +write(str) +write(BLACK) +else: +try: +import ctypes +except ImportError: +pass +else: +STD_OUTPUT_HANDLE = -11 +try: +handle = ctypes.windll.kernel32.GetStdHandle(STD_OUTPUT_HANDLE) +except AttributeError: +pass +else: +def get_csbi_attributes(handle): +# Based on IPython's winconsole.py, written by Alexander Belchenko +csbi = ctypes.create_string_buffer(22) +res = ctypes.windll.kernel32.GetConsoleScreenBufferInfo(handle, csbi) +assert res +(bufx, bufy, curx, cury, wattr, +left, top, right, bottom, maxx, maxy) = struct.unpack("Hhh", csbi.raw) +return wattr +reset = get_csbi_attributes(handle) +def prred(str, write = sys.stdout.write, scta = ctypes.windll.kernel32.SetConsoleTextAttribute): +scta(handle, 0x4) +write(str) +scta(handle, reset) +def prgreen(str, write = sys.stdout.write, scta = ctypes.windll.kernel32.SetConsoleTextAttribute): +scta(handle, 0x2) +write(str) +scta(handle, reset) +def prpurple(str, write = sys.stdout.write, scta = ctypes.windll.kernel32.SetConsoleTextAttribute): +scta(handle, 0x5) +write(str) +scta(handle, reset) if os.path.exists('/usr/bin/coredumpctl'): # probably Linux if /usr/bin/coredumpctl exists @@ -2443,31 +2493,31 @@ def RunTest(env, TST, BusyPorts, COND, o if not verbose and not quiet: if tres == 'socket': -STDOUT.write("%sSOCKET%s" % (PURPLE, BLACK)) +prpurple('SOCKET') elif tres == 'timeout': -STDOUT.write("%sTIMEOUT%s" % (PURPLE, BLACK)) +prpurple('TIMEOUT') elif tres == 'recursion': -STDOUT.write("%sRECURSION%s" % (PURPLE, BLACK)) +prpurple('RECURSION') elif tres == 'segfault': -STDOUT.write("%sCRASHED%s" % (PURPLE, BLACK)) +prpurple('CRASHED') elif tres == 'abort': -STDOUT.write('%sABORTED%s' % (PURPLE, BLACK)) +prpurple('ABORTED') elif tres == 'signal': -STDOUT.write('%sSIGNALED%s' % (PURPLE, BLACK)) +prpurple('SIGNALED') else: if FailedOut == F_OK: -STDOUT.write('%sOK%s ' % (GREEN, BLACK)) +prgreen('OK ') elif FailedOut == F_WARN: -STDOUT.write('%sminor%s' % (GREEN, BLACK)) +prgreen('minor') else: -STDOUT.write('%sMAJOR%s' % (RED, BLACK)) +prred('MAJOR') STDOUT.write(' ') if FailedErr == F_OK: -STDOUT.write('%sOK%s' % (GREEN, BLACK)) +prgreen('OK') elif FailedErr == F_WARN: -
MonetDB: trails - Merge with default
Changeset: c666045c11cd for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c666045c11cd Added Files: sql/backends/monet5/Tests/pyloader06.stable.out.32bit sql/backends/monet5/Tests/pyloader07.stable.out.32bit sql/test/BugTracker-2017/Tests/function-resolution.Bug-6436.sql sql/test/BugTracker-2017/Tests/function-resolution.Bug-6436.stable.err sql/test/BugTracker-2017/Tests/function-resolution.Bug-6436.stable.out sql/test/BugTracker-2017/Tests/generate-resolution.Bug-6471.sql sql/test/BugTracker-2017/Tests/generate-resolution.Bug-6471.stable.err sql/test/BugTracker-2017/Tests/generate-resolution.Bug-6471.stable.out sql/test/BugTracker-2017/Tests/groupby_assertion.Bug-6338.stable.err sql/test/BugTracker-2017/Tests/groupby_assertion.Bug-6338.stable.out sql/test/BugTracker-2017/Tests/parsererror.Bug-6381.stable.err sql/test/BugTracker-2017/Tests/parsererror.Bug-6381.stable.out Modified Files: .hgtags MonetDB.spec NT/monetdb_config.h.in NT/rules.msc clients/Tests/mclient-uri.SQL.sh clients/mapiclient/Tests/mclient--help.stable.err clients/mapiclient/mclient.1 clients/mapiclient/mclient.c clients/mapilib/mapi.rc clients/odbc/driver/driver.rc clients/odbc/winsetup/setup.rc configure.ag debian/changelog gdk/ChangeLog-Archive gdk/ChangeLog.Jul2017 gdk/gdk_aggr.c gdk/libbat.rc libversions monetdb5/modules/kernel/aggr.c monetdb5/optimizer/Tests/manifold2.stable.out.single monetdb5/optimizer/opt_mitosis.c monetdb5/tools/libmonetdb5.rc sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128 sql/benchmarks/tpch/LOCKED/Tests/12.stable.out sql/benchmarks/tpch/LOCKED/Tests/16.stable.out sql/benchmarks/tpch/LOCKED/Tests/18.stable.out sql/benchmarks/tpch/LOCKED/Tests/19.stable.out sql/benchmarks/tpch/LOCKED/Tests/22.stable.out sql/benchmarks/tpch/LOCKED/Tests/22.stable.out.int128 sql/benchmarks/tpch/Tests/01-22.stable.out sql/benchmarks/tpch/Tests/01-22.stable.out.int128 sql/benchmarks/tpch/Tests/12.stable.out sql/benchmarks/tpch/Tests/16.stable.out sql/benchmarks/tpch/Tests/18.stable.out sql/benchmarks/tpch/Tests/19.stable.out sql/benchmarks/tpch/Tests/22.stable.out sql/benchmarks/tpch/Tests/22.stable.out.int128 sql/common/sql_types.c sql/common/sql_types.h sql/server/rel_optimizer.c sql/server/rel_select.c sql/server/rel_updates.c sql/test/BugDay_2005-10-06_2.9.3/Tests/variable_arg_substring.SF_942981.stable.out sql/test/BugTracker-2010/Tests/substring_display_width.Bug-2683.stable.out sql/test/BugTracker-2015/Tests/string_split.Bug-3564.stable.out sql/test/BugTracker-2017/Tests/All sql/test/BugTracker-2017/Tests/cleanup_statistics.Bug-6439.stable.out sql/test/BugTracker-2017/Tests/lateral.Bug-6310.stable.err sql/test/BugTracker-2017/Tests/lateral.Bug-6310.stable.out sql/test/BugTracker-2017/Tests/parsererror.Bug-6381.sql sql/test/BugTracker-2017/Tests/splitpart.Bug-6194.stable.out sql/test/BugTracker-2017/Tests/spurious_error.Bug-6344.stable.out sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6477.stable.err sql/test/Tests/string.stable.out sql/test/emptydb/Tests/check.stable.out.32bit sql/test/pg_regress/Tests/strings.stable.out testing/Mtest.py.in vertoo.data Branch: trails Log Message: Merge with default diffs (truncated from 4442 to 300 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -685,3 +685,5 @@ fce449d5af88de715fde36624815a56ef34c56bb 3d26c58579a18157659b590899a8f73f45954ec6 Jul2017_9 fce449d5af88de715fde36624815a56ef34c56bb Jul2017_SP2_release 3d26c58579a18157659b590899a8f73f45954ec6 Jul2017_SP2_release +b9276cb02ced7d98bcb27b5e6df600b2791f1fcd Jul2017_11 +b9276cb02ced7d98bcb27b5e6df600b2791f1fcd Jul2017_SP3_release diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -132,7 +132,7 @@ Vendor: MonetDB BV Group: Applications/Databases License: MPLv2.0 URL: https://www.monetdb.org/ -Source: https://www.monetdb.org/downloads/sources/Jul2017-SP2/%{name}-%{version}.tar.bz2 +Source: https://www.monetdb.org/downloads/sources/Jul2017-SP3/%{name}-%{version}.tar.bz2 # we need systemd for the _unitdir macro to exist # we need checkpolicy and selinux-policy-devel for the SELinux policy @@ -1046,6 +1046,48 @@ done %postun -p /sbin/ldconfig %changelog +* Mon Dec 04 2017 Sjoerd Mullender - 11.27.11-20171204 +- Rebuilt. +- BZ#3898: Deadlock on insertion +- BZ#6429: ROUND produces wrong data type +- BZ#6436: Query sequence with 2x if
MonetDB: trails - Look out for errors
Changeset: 7887a7f56e9f for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7887a7f56e9f Modified Files: sql/backends/monet5/sql_basket.c sql/backends/monet5/sql_cquery.c Branch: trails Log Message: Look out for errors diffs (66 lines): diff --git a/sql/backends/monet5/sql_basket.c b/sql/backends/monet5/sql_basket.c --- a/sql/backends/monet5/sql_basket.c +++ b/sql/backends/monet5/sql_basket.c @@ -120,6 +120,7 @@ BSKTregisterInternal(Client cntxt, MalBl BAT *b; node *o; str msg = getSQLContext(cntxt, mb, &m, NULL); + timestamp tseen; if ( msg != MAL_SUCCEED) return msg; @@ -130,6 +131,9 @@ BSKTregisterInternal(Client cntxt, MalBl return MAL_SUCCEED; } + if((msg = MTIMEcurrent_timestamp(&tseen)) != MAL_SUCCEED) + return msg; + if ((msg = checkSQLContext(cntxt)) != MAL_SUCCEED) return msg; @@ -149,7 +153,7 @@ BSKTregisterInternal(Client cntxt, MalBl baskets[idx].window = t->stream->window; baskets[idx].stride = t->stream->stride; baskets[idx].error = MAL_SUCCEED; - (void) MTIMEcurrent_timestamp(&baskets[idx].seen); + baskets[idx].seen = tseen; // Check the column types first for (o = t->columns.set->h; o ; o = o->next){ @@ -455,7 +459,7 @@ BSKTtumble(Client cntxt, MalBlkPtr mb, M msg = BSKTregisterInternal(cntxt, mb, sch, tbl, &idx); if( msg != MAL_SUCCEED) return msg; - // don't tumble when the window constraint has not been set to at least 0 o + // don't tumble when the window constraint has not been set to at least 0 or we are not querying from a CQ if( baskets[idx].window < 0 || !cntxt->iscqscheduleruser) return MAL_SUCCEED; /* also take care of time-based tumbling */ diff --git a/sql/backends/monet5/sql_cquery.c b/sql/backends/monet5/sql_cquery.c --- a/sql/backends/monet5/sql_cquery.c +++ b/sql/backends/monet5/sql_cquery.c @@ -1336,7 +1336,7 @@ CQscheduler(void *dummy) int i, j, k = -1, pntasks, delay = cycleDelay, start_trans = 0; Client c = (Client) dummy; mvc* m; - str msg = MAL_SUCCEED; + str msg = MAL_SUCCEED, omsg; lng t, now; timestamp aux; int claimed[MAXSTREAMS]; @@ -1463,7 +1463,13 @@ CQscheduler(void *dummy) if(pnet[i].status != CQDELETE) { pnet[i].run = now; /* last executed */ pnet[i].time = GDKusec() - t; /* keep around in microseconds */ - (void) MTIMEcurrent_timestamp(&pnet[i].seen); + if((omsg = MTIMEcurrent_timestamp(&pnet[i].seen)) != MAL_SUCCEED && !pnet[i].error) { + pnet[i].error = omsg; + pnet[i].status = CQERROR; + } else if(omsg) { + fprintf(stderr, "CQscheduler internal error: %s\n", omsg); + GDKfree(omsg); + } pnet[i].enabled = 0; CQentry(i); } ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: comment-on - Describe and dump COMMENT ON FUNCTION
Changeset: 58db8a2e4921 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=58db8a2e4921 Removed Files: sql/test/Tests/comment-on-routine.sql sql/test/Tests/comment-on-routine.stable.err sql/test/Tests/comment-on-routine.stable.out Modified Files: clients/mapiclient/dump.c sql/scripts/97_comments.sql sql/test/Tests/comment-on.sql sql/test/Tests/comment-on.stable.err sql/test/Tests/comment-on.stable.out Branch: comment-on Log Message: Describe and dump COMMENT ON FUNCTION diffs (truncated from 541 to 300 lines): diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c --- a/clients/mapiclient/dump.c +++ b/clients/mapiclient/dump.c @@ -1245,6 +1245,94 @@ dump_table(Mapi mid, char *schema, char return rc; } +static int +dump_function_comments(Mapi mid, stream *toConsole, const char *schema, const char *fname, char wantSystem) +{ + size_t len = 400 + (schema ? strlen(schema) : 0) + (fname ? strlen(fname) : 0); + char *query = malloc(len); + char *q = query; + char *end_q = q + len; + char *where = "WHERE"; + MapiHdl hdl = NULL; + int hashge; + + if (!query) + return 1; + + q += snprintf(q, end_q - q, "SELECT category, schema, name, type, type_digits, type_scale, remark "); + q += snprintf(q, end_q - q, "FROM sys.commented_function_signatures"); + if (!wantSystem) { + q += snprintf(q, end_q - q, " %s system = FALSE", where); + where = "AND"; + } + if (schema) { + q += snprintf(q, end_q - q, " %s schema = '%s'", where, schema); + where = "AND"; + } + if (fname) { + q += snprintf(q, end_q - q, " %s fname = '%s'", where, fname); + where = "AND"; + } + q += snprintf(q, end_q - q, " ORDER BY line;"); + if (q >= end_q - 1) + goto bailout; + + hashge = has_hugeint(mid); + hdl = mapi_query(mid, query); + if (hdl == NULL || mapi_error(mid)) + goto bailout; + while (!mnstr_errnr(toConsole) && mapi_fetch_row(hdl) != 0) { + int i = 0; + char *category = mapi_fetch_field(hdl, i++); + char *sname = mapi_fetch_field(hdl, i++); + char *name = mapi_fetch_field(hdl, i++); + char *type = mapi_fetch_field(hdl, i++); + char *type_digits = mapi_fetch_field(hdl, i++); + char *type_scale = mapi_fetch_field(hdl, i++); + char *remark = mapi_fetch_field(hdl, i++); + + if (name) { + mnstr_printf(toConsole, "COMMENT ON %s ", category); + quoted_print(toConsole, sname, 0); + mnstr_printf(toConsole, "."); + quoted_print(toConsole, name, 0); + mnstr_printf(toConsole, "("); + } else { + mnstr_printf(toConsole, ", "); + } + + if (type) { + dump_type(NULL, toConsole, type, type_digits, type_scale, hashge); + } + + if (remark) { + mnstr_printf(toConsole, ") IS "); + quoted_print(toConsole, remark, 1); + mnstr_printf(toConsole, ";\n"); + } + } + if (mapi_error(mid)) + goto bailout; + + free(query); + mapi_close_handle(hdl); + return 0; + + bailout: + if (query) + free(query); + if (hdl) { + if (mapi_result_error(hdl)) + mapi_explain_result(hdl, stderr); + else + mapi_explain_query(hdl, stderr); + mapi_close_handle(hdl); + } else + mapi_explain(mid, stderr); + + return 1; +} + int dump_functions(Mapi mid, stream *toConsole, const char *fname) { @@ -1277,7 +1365,7 @@ dump_functions(Mapi mid, stream *toConso return 1; } - dumpSystem = sname && fname; + dumpSystem = !!fname; l = sizeof(functions) + (sname ? strlen(sname) : 0) + 100; q = malloc(l); @@ -1301,6 +1389,12 @@ dump_functions(Mapi mid, stream *toConso } if (mapi_error(mid)) goto bailout; + + if (dump_function_comments(mid, toConsole, sname, fname, fname != NULL) != 0) + goto bailout; + + if (mapi_error(mid)) + goto bailout; if (sname) free(sname); mapi_close_handle(hdl); @@ -1796,6 +1890,9 @@ dump_database(Mapi mid, stream *toConsol mapi_close_handle(hdl); hdl = NULL; + if (dump_function_comments(mid, toConsole, NULL, NULL, 0) != 0) + goto bailout; + if (curschema) { if (strcmp(sname ? sname :
MonetDB: comment-on - Merge default into comment-on
Changeset: 38468dc318bb for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=38468dc318bb Added Files: sql/test/BugTracker-2009/Tests/AVG_of_SQRT.SF-2757642.sql sql/test/BugTracker-2017/Tests/corr_coersion.Bug-6287.sql sql/test/BugTracker-2017/Tests/corr_coersion.Bug-6287.stable.err sql/test/BugTracker-2017/Tests/corr_coersion.Bug-6287.stable.out sql/test/BugTracker-2017/Tests/double-groupby-column.Bug-6207.sql sql/test/BugTracker-2017/Tests/double-groupby-column.Bug-6207.stable.err sql/test/BugTracker-2017/Tests/double-groupby-column.Bug-6207.stable.out sql/test/BugTracker-2017/Tests/insert_into_multiple_subqueries.Bug-6448.sql sql/test/BugTracker-2017/Tests/insert_into_multiple_subqueries.Bug-6448.stable.err sql/test/BugTracker-2017/Tests/insert_into_multiple_subqueries.Bug-6448.stable.out sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-distinct-coalesce.Bug-6431.sql sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-distinct-coalesce.Bug-6431.stable.err sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-distinct-coalesce.Bug-6431.stable.out sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-distinct.Bug-6411.sql sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-distinct.Bug-6411.stable.err sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-distinct.Bug-6411.stable.out sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-having-avg.Bug-6428.sql sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-having-avg.Bug-6428.stable.err sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-having-avg.Bug-6428.stable.out sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-not-in.Bug-6416.sql sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-not-in.Bug-6416.stable.err sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-not-in.Bug-6416.stable.out sql/test/BugTracker-2017/Tests/sqlitelogictest-cast-decimal.Bug-6445.sql sql/test/BugTracker-2017/Tests/sqlitelogictest-cast-decimal.Bug-6445.stable.err sql/test/BugTracker-2017/Tests/sqlitelogictest-cast-decimal.Bug-6445.stable.out sql/test/BugTracker-2017/Tests/sqlitelogictest-having-with-in.Bug-6410.sql sql/test/BugTracker-2017/Tests/sqlitelogictest-having-with-in.Bug-6410.stable.err sql/test/BugTracker-2017/Tests/sqlitelogictest-having-with-in.Bug-6410.stable.out sql/test/BugTracker-2017/Tests/sqlitelogictest-having-with-not-in.Bug-6409.sql sql/test/BugTracker-2017/Tests/sqlitelogictest-having-with-not-in.Bug-6409.stable.err sql/test/BugTracker-2017/Tests/sqlitelogictest-having-with-not-in.Bug-6409.stable.out sql/test/BugTracker-2017/Tests/sqlitelogictest-select-in.Bug-6433.sql sql/test/BugTracker-2017/Tests/sqlitelogictest-select-in.Bug-6433.stable.err sql/test/BugTracker-2017/Tests/sqlitelogictest-select-in.Bug-6433.stable.out sql/test/BugTracker-2017/Tests/sqlitelogictest-select-not-in.Bug-6435.sql sql/test/BugTracker-2017/Tests/sqlitelogictest-select-not-in.Bug-6435.stable.err sql/test/BugTracker-2017/Tests/sqlitelogictest-select-not-in.Bug-6435.stable.out sql/test/BugTracker-2017/Tests/sqllitelogistest_case.Bug-6335.stable.err sql/test/BugTracker-2017/Tests/sqllitelogistest_case.Bug-6335.stable.out sql/test/BugTracker-2017/Tests/sqlsmith-semijoin-constant.bug-6417.sql sql/test/BugTracker-2017/Tests/sqlsmith-semijoin-constant.bug-6417.stable.err sql/test/BugTracker-2017/Tests/sqlsmith-semijoin-constant.bug-6417.stable.out sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6418.sql sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6418.stable.err sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6418.stable.out sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6423.sql sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6423.stable.err sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6423.stable.out sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6424.sql sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6424.stable.err sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6424.stable.out sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6425.sql sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6425.stable.err sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6425.stable.out sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6432.sql sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6432.stable.err sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6432.stable.out sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6449.sql sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6449.stable.err sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6449.stable.out sql/test/Bu
MonetDB: comment-on - Simplify code
Changeset: 92053d1bffe0 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=92053d1bffe0 Modified Files: clients/mapiclient/dump.c clients/mapiclient/dumpcomment.c clients/mapiclient/dumpcomment.h clients/mapiclient/mclient.c clients/mapiclient/msqldump.c clients/mapiclient/msqldump.h sql/test/Tests/comment-on.stable.out Branch: comment-on Log Message: Simplify code Always create comments->buf instead of only on demand. Eliminate sname parameter of dump_functions because it isn't used. diffs (229 lines): diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c --- a/clients/mapiclient/dump.c +++ b/clients/mapiclient/dump.c @@ -1246,7 +1246,7 @@ dump_table(Mapi mid, char *schema, char } int -dump_functions(Mapi mid, stream *toConsole, const char *sname, const char *fname) +dump_functions(Mapi mid, stream *toConsole, const char *fname) { const char functions[] = "SELECT f.func " @@ -1261,22 +1261,20 @@ dump_functions(Mapi mid, stream *toConso char *q; size_t l; char dumpSystem; - char *schema = NULL; - - if (sname == NULL) { - if (fname == NULL) { - schema = NULL; - } else if ((schema = strchr(fname, '.')) != NULL) { - size_t len = schema - fname; + char *sname = NULL; + char *dot = NULL; /* location of dot in fname */ - schema = malloc(len + 1); - strncpy(schema, fname, len); - schema[len] = 0; - fname += len + 1; - } else if ((schema = get_schema(mid)) == NULL) { - return 1; - } - sname = schema; + if (fname == NULL) { + sname = NULL; + } else if ((dot = strchr(fname, '.')) != NULL) { + size_t len = dot - fname; + + sname = malloc(len + 1); + strncpy(sname, fname, len); + sname[len] = 0; + fname += len + 1; + } else if ((sname = get_schema(mid)) == NULL) { + return 1; } dumpSystem = sname && fname; @@ -1303,14 +1301,14 @@ dump_functions(Mapi mid, stream *toConso } if (mapi_error(mid)) goto bailout; - if (schema) - free(schema); + if (sname) + free(sname); mapi_close_handle(hdl); return mnstr_errnr(toConsole) != 0; bailout: - if (schema) - free(schema); + if (sname) + free(sname); if (hdl) { if (mapi_result_error(hdl)) mapi_explain_result(hdl, stderr); diff --git a/clients/mapiclient/dumpcomment.c b/clients/mapiclient/dumpcomment.c --- a/clients/mapiclient/dumpcomment.c +++ b/clients/mapiclient/dumpcomment.c @@ -54,18 +54,39 @@ struct comment_buffer { comment_buffer* comment_buffer_create(void) { +buffer *buf; +stream *s; comment_buffer *comments; +buf = buffer_create(4000); +if (!buf) +return NULL; + +s = buffer_wastream(buf, "comments_buffer"); +if (s == NULL) { +buffer_destroy(buf); +return NULL; +} + comments = malloc(sizeof(*comments)); -if (comments == NULL) +if (comments == NULL) { +mnstr_destroy(s); +buffer_destroy(buf); return NULL; - -comments->buf = NULL; -comments->append = NULL; +} + +comments->buf = buf; +comments->append = s; return comments; } +stream * +comment_appender(comment_buffer *comments) +{ +return comments->append; +} + int append_comment( comment_buffer *comments, @@ -81,23 +102,6 @@ append_comment( if (!remark) return 0; -assert((comments->buf == NULL) == (comments->append == NULL)); -if (comments->buf == NULL) { -buffer *buf; -stream *s; - -buf = buffer_create(4000); -if (buf == NULL) -return 1; -s = buffer_wastream(buf, "comments_buffer"); -if (s == NULL) { -buffer_destroy(buf); -return 1; -} -comments->buf = buf; -comments->append = s; -} - mnstr_printf(comments->append, "COMMENT ON %s ", obj_type); if (schema_name) { mnstr_printf(comments->append, "%s", sep); @@ -122,7 +126,7 @@ append_comment( return 0; } - + int write_comment_buffer(stream *out, comment_buffer *comments) { @@ -144,11 +148,7 @@ write_comment_buffer(stream *out, commen void comment_buffer_destroy(comment_buffer *comments) { -if
MonetDB: comment-on - Dump comments on views, sequences and schemas
Changeset: 0b749d93cd1c for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0b749d93cd1c Modified Files: clients/mapiclient/dump.c sql/test/Tests/All sql/test/Tests/comment-on.sql Branch: comment-on Log Message: Dump comments on views, sequences and schemas diffs (197 lines): diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c --- a/clients/mapiclient/dump.c +++ b/clients/mapiclient/dump.c @@ -1417,8 +1417,8 @@ dump_database(Mapi mid, stream *toConsol "AND f.id NOT IN (SELECT function_id FROM sys.systemfunctions) " "ORDER BY s.name, f.name, a.name, g.name, p.grantable"; const char *schemas = - "SELECT s.name, a.name " - "FROM sys.schemas s, " + "SELECT s.name, a.name, rem.remark " + "FROM sys.schemas s LEFT OUTER JOIN sys.comments rem ON s.id = rem.id, " "sys.auths a " "WHERE s.\"authorization\" = a.id AND " "s.system = FALSE " @@ -1443,9 +1443,9 @@ dump_database(Mapi mid, stream *toConsol anymore. */ const char *sequences1 = - "SELECT sch.name,seq.name " + "SELECT sch.name,seq.name, rem.remark " "FROM sys.schemas sch, " -"sys.sequences seq " +"sys.sequences seq LEFT OUTER JOIN sys.comments rem ON seq.id = rem.id " "WHERE sch.id = seq.schema_id " "ORDER BY sch.name,seq.name"; const char *sequences2 = @@ -1476,40 +1476,50 @@ dump_database(Mapi mid, stream *toConsol * creation since they can refer to each other */ const char *views_functions_triggers = "WITH vft AS (" - "SELECT s.name AS sname, " - "t.id AS id, " - "t.query AS query " - "FROM sys.schemas s, " + "SELECT t.id AS id, " + "s.name AS sname, " + "t.name AS name, " + "'VIEW' AS objtype, " + "t.query AS query, " + "rem.remark AS remark " + "FROM sys.schemas s LEFT OUTER JOIN sys.comments rem ON s.id = rem.id, " "sys._tables t " "WHERE t.type = 1 AND " "t.system = FALSE AND " "s.id = t.schema_id AND " "s.name <> 'tmp' " "UNION " - "SELECT s.name AS sname, " - "f.id AS id, " - "f.func AS query " + "SELECT f.id AS id, " + "s.name AS sname, " + "f.name AS name, " + "NULL AS objtype, " + "f.func AS query, " + "NULL AS remark " "FROM sys.schemas s, " "sys.functions f " "WHERE f.language < 3 AND " "s.id = f.schema_id " "AND f.id NOT IN (SELECT function_id FROM sys.systemfunctions) " "UNION " - "SELECT s.name AS sname, " - "tr.id AS id, " - "tr.\"statement\" AS query " + "SELECT tr.id AS id, " + "s.name AS sname, " + "tr.name AS name, " + "NULL AS objtype, " + "tr.\"statement\" AS query, " + "NULL AS remark " "FROM sys.triggers tr, " "sys.schemas s, " "sys._tables t " "WHERE s.id = t.schema_id AND " "t.id = tr.table_id" ") " - "SELECT sname, query FROM vft ORDER BY id"; + "SELECT sname, name, objtype, query, remark FROM vft ORDER BY id"; char *sname = NULL; char *curschema = NULL; MapiHdl hdl; int create_hash_func = 0; int rc = 0; + comment_buffer *comments = comment_buffer_create(); /* start a transaction for the dump */ if (!describe) @@ -1587,17 +1597,20 @@ dump_database(Mapi mid, stream *toConsol while (mapi_fetch_row(hdl) != 0) { char *sname = mapi_fetch_field(hdl, 0); char *aname = mapi_fetch_field(hdl, 1); + char *remark = mapi_fetch_field(hdl, 2); mnstr_printf(toConsole, "CREATE SCHEMA \"%s\"", sname);
MonetDB: comment-on - Describe COMMENT ON index
Changeset: 62d4d02a53d2 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=62d4d02a53d2 Removed Files: sql/test/Tests/comment-on-index.sql sql/test/Tests/comment-on-index.stable.err sql/test/Tests/comment-on-index.stable.out Modified Files: clients/mapiclient/dump.c sql/test/Tests/comment-on.sql sql/test/Tests/comment-on.stable.out Branch: comment-on Log Message: Describe COMMENT ON index diffs (truncated from 301 to 300 lines): diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c --- a/clients/mapiclient/dump.c +++ b/clients/mapiclient/dump.c @@ -839,9 +839,11 @@ describe_table(Mapi mid, char *schema, c "SELECT i.name, " /* 0 */ "k.name, " /* 1 */ "kc.nr, " /* 2 */ - "c.name " /* 3 */ -"FROM sys.idxs AS i LEFT JOIN sys.keys AS k " - "ON i.name = k.name, " + "c.name, " /* 3 */ + "rem.remark " /* 4 */ +"FROM sys.idxs AS i " + "LEFT JOIN sys.keys AS k ON i.name = k.name " + "LEFT OUTER JOIN sys.comments rem ON i.id = rem.id, " "sys.objects AS kc, " "sys._columns AS c, " "sys.schemas s, " @@ -863,6 +865,7 @@ describe_table(Mapi mid, char *schema, c char *k_name = mapi_fetch_field(hdl, 1); char *kc_nr = mapi_fetch_field(hdl, 2); char *c_name = mapi_fetch_field(hdl, 3); + char *remark = mapi_fetch_field(hdl, 4); if (mapi_error(mid)) goto bailout; @@ -877,6 +880,7 @@ describe_table(Mapi mid, char *schema, c mnstr_printf(toConsole, "CREATE INDEX \"%s\" ON \"%s\".\"%s\" (", i_name, schema, tname); + append_comment(comments, "INDEX", schema, i_name, NULL, NULL, remark); cnt = 1; } else mnstr_printf(toConsole, ", "); diff --git a/sql/test/Tests/comment-on-index.sql b/sql/test/Tests/comment-on-index.sql deleted file mode 100644 --- a/sql/test/Tests/comment-on-index.sql +++ /dev/null @@ -1,60 +0,0 @@ -DROP SCHEMA IF EXISTS sch; -CREATE SCHEMA sch; -SET SCHEMA sch; - -CREATE TABLE origs AS SELECT id FROM sys.comments; - -CREATE FUNCTION all_kinds_of_object() -RETURNS TABLE (id INTEGER, name VARCHAR(80), type VARCHAR(30)) -RETURN TABLE ( -SELECT id, name, table_type_name -FROM sys.tables, sys.table_types -WHERE type = table_type_id -UNION ALL -SELECT id, name, 'SCHEMA' -FROM sys.schemas -UNION ALL -SELECT c.id, t.name || '.' || c.name, 'COLUMN' -FROM sys.columns AS c, sys.tables AS t -WHERE c.table_id = t.id -UNION ALL -SELECT id, name, 'INDEX' -FROM sys.idxs -UNION ALL -SELECT id, name, 'SEQUENCE' -FROM sys.sequences -UNION ALL -SELECT id, name, function_type_name -FROM sys.functions, sys.function_types -WHERE type = function_type_id -); - -CREATE FUNCTION new_comments() -RETURNS TABLE (name VARCHAR(80), source VARCHAR(30), remark CLOB) -RETURN TABLE ( -SELECT o.name, o.type, c.remark -FROM sys.comments AS c LEFT JOIN all_kinds_of_object() AS o ON c.id = o.id -WHERE c.id NOT IN (SELECT id FROM origs) -); - - - --- create an index and comment on it -CREATE TABLE tab (i INTEGER); -CREATE INDEX idx ON tab(i); -COMMENT ON INDEX idx IS 'an index'; -SELECT * FROM new_comments(); - --- explicit schema -COMMENT ON INDEX sch.idx IS 'a qualified index'; -SELECT * FROM new_comments(); - --- check that deletes cascade -DROP INDEX idx; -SELECT * FROM new_comments(); - --- full cascade -CREATE INDEX idx ON tab(i); -COMMENT ON INDEX idx IS 'an index'; -DROP TABLE tab; -SELECT * FROM new_comments(); diff --git a/sql/test/Tests/comment-on-index.stable.err b/sql/test/Tests/comment-on-index.stable.err deleted file mode 100644 --- a/sql/test/Tests/comment-on-index.stable.err +++ /dev/null @@ -1,35 +0,0 @@ -stderr of test 'comment-on-index` in directory 'sql/test` itself: - - -# 13:19:30 > -# 13:19:30 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=33602" "--set" "mapi_usock=/var/tmp/mtest-62171/.s.monetdb.33602" "--set" "monet_prompt=" "--forcemito" "--dbpath=/Users/joeri/mon
MonetDB: comment-on - Support COMMENT ON SEQUENCE
Changeset: 7e8be5c834ba for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7e8be5c834ba Removed Files: sql/test/Tests/comment-on-sequence.sql sql/test/Tests/comment-on-sequence.stable.err sql/test/Tests/comment-on-sequence.stable.out Modified Files: clients/mapiclient/dump.c sql/test/Tests/comment-on.sql sql/test/Tests/comment-on.stable.err sql/test/Tests/comment-on.stable.out Branch: comment-on Log Message: Support COMMENT ON SEQUENCE diffs (truncated from 338 to 300 lines): diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c --- a/clients/mapiclient/dump.c +++ b/clients/mapiclient/dump.c @@ -929,6 +929,7 @@ describe_sequence(Mapi mid, char *schema char *query; size_t maxquerylen; char *sname = NULL; + comment_buffer *comments = comment_buffer_create(); if (schema == NULL) { if ((sname = strchr(tname, '.')) != NULL) { @@ -954,8 +955,9 @@ describe_sequence(Mapi mid, char *schema "seq.\"minvalue\", " "seq.\"maxvalue\", " "seq.\"increment\", " -"seq.\"cycle\" " - "FROM sys.sequences seq, " +"seq.\"cycle\", " +"rem.\"remark\" " + "FROM sys.sequences seq LEFT OUTER JOIN sys.comments rem ON seq.id = rem.id, " "sys.schemas s " "WHERE s.id = seq.schema_id AND " "s.name = '%s' AND " @@ -974,6 +976,7 @@ describe_sequence(Mapi mid, char *schema char *maxvalue = mapi_fetch_field(hdl, 4); char *increment = mapi_fetch_field(hdl, 5); char *cycle = mapi_fetch_field(hdl, 6); + char *remark = mapi_fetch_field(hdl, 7); mnstr_printf(toConsole, "CREATE SEQUENCE \"%s\".\"%s\" START WITH %s", @@ -985,12 +988,15 @@ describe_sequence(Mapi mid, char *schema if (strcmp(maxvalue, "0") != 0) mnstr_printf(toConsole, " MAXVALUE %s", maxvalue); mnstr_printf(toConsole, " %sCYCLE;\n", strcmp(cycle, "true") == 0 ? "" : "NO "); + append_comment(comments, "SEQUENCE", schema, tname, NULL, NULL, remark); if (mnstr_errnr(toConsole)) { mapi_close_handle(hdl); hdl = NULL; goto bailout; } } + write_comment_buffer(toConsole, comments); + comment_buffer_destroy(comments); if (mapi_error(mid)) goto bailout; if (sname != NULL) @@ -1002,6 +1008,7 @@ describe_sequence(Mapi mid, char *schema return 0; bailout: + comment_buffer_destroy(comments); if (hdl) { if (mapi_result_error(hdl)) mapi_explain_result(hdl, stderr); diff --git a/sql/test/Tests/comment-on-sequence.sql b/sql/test/Tests/comment-on-sequence.sql deleted file mode 100644 --- a/sql/test/Tests/comment-on-sequence.sql +++ /dev/null @@ -1,53 +0,0 @@ -DROP SCHEMA IF EXISTS sch; -CREATE SCHEMA sch; -SET SCHEMA sch; - -CREATE TABLE origs AS SELECT id FROM sys.comments; - -CREATE FUNCTION all_kinds_of_object() -RETURNS TABLE (id INTEGER, name VARCHAR(80), type VARCHAR(30)) -RETURN TABLE ( -SELECT id, name, table_type_name -FROM sys.tables, sys.table_types -WHERE type = table_type_id -UNION ALL -SELECT id, name, 'SCHEMA' -FROM sys.schemas -UNION ALL -SELECT c.id, t.name || '.' || c.name, 'COLUMN' -FROM sys.columns AS c, sys.tables AS t -WHERE c.table_id = t.id -UNION ALL -SELECT id, name, 'INDEX' -FROM sys.idxs -UNION ALL -SELECT id, name, 'SEQUENCE' -FROM sys.sequences -UNION ALL -SELECT id, name, function_type_name -FROM sys.functions, sys.function_types -WHERE type = function_type_id -); - -CREATE FUNCTION new_comments() -RETURNS TABLE (name VARCHAR(80), source VARCHAR(30), remark CLOB) -RETURN TABLE ( -SELECT o.name, o.type, c.remark -FROM sys.comments AS c LEFT JOIN all_kinds_of_object() AS o ON c.id = o.id -WHERE c.id NOT IN (SELECT id FROM origs) -); - - - --- create a sequence and comment on it -CREATE SEQUENCE seq AS INT; -COMMENT ON SEQUENCE seq IS 'a few numbers'; -SELECT * FROM new_comments(); - --- explicit schema -COMMENT ON SEQUENCE sch.seq IS 'a few more numbers'; -SELECT * FROM new_comments(); - --- check that deletes cascade -DROP SEQUENCE seq; -SELECT * FROM new_comments(); diff --git a/sql/test/Tests/comment-on-sequence.stable.err b/sql/test/Tests/comment-on-sequence.stable.err deleted file mode 100644 --- a/sql/test/Tests/comment-on-sequence.stable.err +++ /dev/null @@ -1,3
MonetDB: comment-on - Move to mclient based testing of COMMENT ON
Changeset: c63ee9de77d0 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c63ee9de77d0 Added Files: sql/test/Tests/comment-on.sql sql/test/Tests/comment-on.stable.err sql/test/Tests/comment-on.stable.out Removed Files: sql/test/Tests/comment-on-column.sql sql/test/Tests/comment-on-column.stable.err sql/test/Tests/comment-on-column.stable.out sql/test/Tests/comment-on-schema.sql sql/test/Tests/comment-on-schema.stable.err sql/test/Tests/comment-on-schema.stable.out sql/test/Tests/comment-on-table.sql sql/test/Tests/comment-on-table.stable.err sql/test/Tests/comment-on-table.stable.out sql/test/Tests/comment-on-view.sql sql/test/Tests/comment-on-view.stable.err sql/test/Tests/comment-on-view.stable.out Modified Files: sql/test/Tests/All Branch: comment-on Log Message: Move to mclient based testing of COMMENT ON diffs (truncated from 1229 to 300 lines): diff --git a/sql/test/Tests/All b/sql/test/Tests/All --- a/sql/test/Tests/All +++ b/sql/test/Tests/All @@ -101,10 +101,7 @@ median_stdev ifexists ifexists-views subqueries -comment-on-schema -comment-on-table -comment-on-view -comment-on-column +comment-on comment-on-index comment-on-sequence comment-on-routine diff --git a/sql/test/Tests/comment-on-column.sql b/sql/test/Tests/comment-on-column.sql deleted file mode 100644 --- a/sql/test/Tests/comment-on-column.sql +++ /dev/null @@ -1,57 +0,0 @@ -DROP SCHEMA IF EXISTS sch; -CREATE SCHEMA sch; -SET SCHEMA sch; - -CREATE TABLE origs AS SELECT id FROM sys.comments; - -CREATE FUNCTION all_kinds_of_object() -RETURNS TABLE (id INTEGER, name VARCHAR(80), type VARCHAR(30)) -RETURN TABLE ( -SELECT id, name, table_type_name -FROM sys.tables, sys.table_types -WHERE type = table_type_id -UNION ALL -SELECT id, name, 'SCHEMA' -FROM sys.schemas -UNION ALL -SELECT c.id, t.name || '.' || c.name, 'COLUMN' -FROM sys.columns AS c, sys.tables AS t -WHERE c.table_id = t.id -UNION ALL -SELECT id, name, 'INDEX' -FROM sys.idxs -UNION ALL -SELECT id, name, 'SEQUENCE' -FROM sys.sequences -UNION ALL -SELECT id, name, function_type_name -FROM sys.functions, sys.function_types -WHERE type = function_type_id -); - -CREATE FUNCTION new_comments() -RETURNS TABLE (name VARCHAR(80), source VARCHAR(30), remark CLOB) -RETURN TABLE ( -SELECT o.name, o.type, c.remark -FROM sys.comments AS c LEFT JOIN all_kinds_of_object() AS o ON c.id = o.id -WHERE c.id NOT IN (SELECT id FROM origs) -); - - - --- create a table and comment on a column -CREATE TABLE tab (i integer, j integer); -COMMENT ON COLUMN tab.i IS 'A column'; -SELECT * FROM new_comments(); - --- again, with an explicit schema reference -COMMENT ON COLUMN sch.tab.j IS 'Another comment'; -SELECT * FROM new_comments(); - --- it's dropped if the column is dropped -ALTER TABLE tab DROP COLUMN i; -SELECT * FROM new_comments(); - --- and if the table is dropped -DROP TABLE tab; -SELECT * FROM new_comments(); diff --git a/sql/test/Tests/comment-on-column.stable.err b/sql/test/Tests/comment-on-column.stable.err deleted file mode 100644 --- a/sql/test/Tests/comment-on-column.stable.err +++ /dev/null @@ -1,34 +0,0 @@ -stderr of test 'comment-on-column` in directory 'sql/test` itself: - - -# 14:33:08 > -# 14:33:08 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=32241" "--set" "mapi_usock=/var/tmp/mtest-62023/.s.monetdb.32241" "--set" "monet_prompt=" "--forcemito" "--dbpath=/Users/joeri/monets/default/var/MonetDB/mTests_sql_test" -# 14:33:08 > - -# builtin opt gdk_dbpath = /Users/joeri/monets/default/var/monetdb5/dbfarm/demo -# builtin opt gdk_debug = 0 -# builtin opt gdk_vmtrim = no -# builtin opt monet_prompt = > -# builtin opt monet_daemon = no -# builtin opt mapi_port = 5 -# builtin opt mapi_open = false -# builtin opt mapi_autosense = false -# builtin opt sql_optimizer = default_pipe -# builtin opt sql_debug = 0 -# cmdline opt gdk_nr_threads = 0 -# cmdline opt mapi_open = true -# cmdline opt mapi_port = 32241 -# cmdline opt mapi_usock = /var/tmp/mtest-62023/.s.monetdb.32241 -# cmdline opt monet_prompt = -# cmdline opt gdk_dbpath = /Users/joeri/monets/default/var/MonetDB/mTests_sql_test -# cmdline opt gdk_debug = 536870922 - -# 14:33:08 > -# 14:33:08 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-62023" "--port=32241" -# 14:33:08 > - - -# 14:33:09 > -# 14:33:09 > "Done." -# 14:33:09 > - diff --git a/sql/test/Tests/comment-on-column.stable.out b/sql/test/Tests/comment-on-column.stable.out deleted file mode 100644 --- a/sql/test/Tests/comment-on-column.stable.out +++ /dev/null
MonetDB: default - Increase size of buffer.
Changeset: 914949fcc5bd for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=914949fcc5bd Modified Files: clients/mapiclient/mclient.c Branch: default Log Message: Increase size of buffer. diffs (12 lines): diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -280,7 +280,7 @@ static enum itimers { T_NONE // don't render the timing information } timermode = T_CLOCK; -static char htimbuf[64]; +static char htimbuf[128]; static char * timerHuman(int64_t sqloptimizer, int64_t maloptimizer, int64_t querytime) { ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list