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 <i...@monetdb.org>
 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 <sjo...@acm.org> - 11.27.11-20171204
+- Rebuilt.
+- BZ#3898: Deadlock on insertion
+- BZ#6429: ROUND produces wrong data type
+- BZ#6436: Query sequence with 2x ifthenelse() and next nullif() causes
+  mserver5 Segmentation fault
+- BZ#6439: Invalid references to sys.columns.id from
+  sys.statistics.column_id
+- BZ#6442: SEGFAULT with COPY INTO BEST EFFORT and skipping input columns
+- BZ#6443: complex(?) query forgets(?) column name
+- BZ#6444: Using 'with' keyword with table returning function crashes
+  monetdb
+- BZ#6445: Sqlitelogictest crash in MySQL query
+- BZ#6446: sql_parser.y bug?
+- BZ#6448: 'insert into' with multiple rows containing subqueries crashes
+- BZ#6449: Assertion error in rel_dce_refs (sqlsmith)
+- BZ#6450: Assertion error in exp_bin (sqlsmith)
+- BZ#6451: Assertion error in sql_ref_dec (sqlsmith)
+- BZ#6453: Assertion error  in rel_rename_exps (sqlsmith)
+- BZ#6454: SQL lexical error
+- BZ#6455: Assertion error in rel_apply_rewrite (sqlsmith)
+- BZ#6456: NULL becomes 0 in outer join
+- BZ#6459: Assertion error in exp_bin (sqlsmith)
+- BZ#6462: large virtual memory spike on BLOB column select
+- BZ#6465: appending to variables sized atom bats other than str bats
+  with force flag may result in corrupted heap
+- BZ#6467: date_to_str formatter is wrong
+- BZ#6470: mitosis gets in the way of simple select
+- BZ#6471: calls to sys.generate_series should auto-convert arguments
+- BZ#6472: Assertion failure in rel_rename (Sqlsmith)
+- BZ#6477: assertion eror rel_push_project_up (sqlsmith)
+- BZ#6478: Crash with nested order by/ limit offset
+- BZ#6479: Mserver receives an assertion error on a procedure call
+- BZ#6480: Segfault in mvc_find_subexp (sqlsmith)
+
+* Sun Nov  5 2017 Sjoerd Mullender <sjo...@acm.org> - 11.27.11-20171204
+- gdk: Reimplemented summing of a column of floating point (flt and dbl)
+  values.  The old code could give wildly inaccurate results when adding
+  up lots and lots of values due to lack of precision.  Try SELECT sum(c)
+  FROM t; where t is 100,000,000 rows, c is of type REAL and all values
+  are equal to 1.1.  (The old code returned 33554432 instead of 1.1e8.)
+
 * Sun Nov  5 2017 Sjoerd Mullender <sjo...@acm.org> - 11.27.9-20171105
 - BZ#6460 - selinux doen't allow mmap
 
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          | --echo            echo 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,20 @@ these are supported.
 Specify the portnumber of the server (default:
 .BR 50000 ).
 .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
+
+\fB\-\-timer\fP[\fB=\fP\fItimermode\fP] 
+The \fItimer\fP command controls the
 format of the time reported for queries.
-Note that no space is allowed between
-.B \-i
-and
-.IR timermode .
-The default mode is
-\fBhuman\fP which adjusts the time precision to the measured value.
-The modes \fBms\fP, \fBs\fP and \fBm\fP force millisecond, second and
-minute + second precision respectively.
+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
 \fB\-\-user\fP\fB=\fP\fIuser\fP (\fB\-u\fP \fIuser\fP)
 Specify the user to connect as.
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -87,18 +87,18 @@ static int errseen = 0;
 #define setPrompt() sprintf(promptbuf, "%.*s>", (int) sizeof(promptbuf) - 2, 
language)
 #define debugMode() (strncmp(promptbuf, "mdb", 3) == 0)
 
-/* the internal formatters */
+/* the internal result set formatters */
 enum formatters {
        NOformatter,
-       RAWformatter,
-       TABLEformatter,
-       CSVformatter,
-       XMLformatter,
-       TESTformatter,
-       CLEANformatter,
-       TIMERformatter,
-       SAMformatter,
-       EXPANDEDformatter
+       RAWformatter,           // as the data is received
+       TABLEformatter,         // render as a bordered table
+       CSVformatter,           // render as a comma separate file
+       XMLformatter,           // render as a valid XML document
+       JSONformatter,          // render as a valid JSON document
+       TESTformatter,          // for testing, escape characters
+       TRASHformatter,         // remove the result set 
+       SAMformatter,           // render a SAM result set
+       EXPANDEDformatter       // render as multi-row single record
 };
 static enum formatters formatter = NOformatter;
 char *separator = NULL;                /* column separator for CSV/TAB format 
*/
@@ -109,9 +109,6 @@ int csvheader = 0;          /* include header li
 /* use a 64 bit integer for the timer */
 typedef int64_t timertype;
 #define TTFMT "%" PRId64
-#if 0
-static char *mark, *mark2;
-#endif
 
 static timertype t0, t1;       /* used for timing */
 
@@ -264,12 +261,6 @@ timerEnd(void)
        mnstr_flush(toConsole);
        t1 = gettime();
        assert(t1 >= t0);
-#if 0
-       if (mark && specials == NOmodifier) {
-               fprintf(stderr, "%s " TTFMT ".%03d msec %s\n", mark, (t1 - t0) 
/ 1000, (int) ((t1 - t0) % 1000), mark2 ? mark2 : "");
-               fflush(stderr);
-       }
-#endif
 }
 
 static timertype th = 0;
@@ -280,33 +271,67 @@ timerHumanStop(void)
 }
 
 static enum itimers {
-       T_HUMAN = 0,
-       T_MILLIS,
+       T_CLOCK = 0,    // render wallclock time in human readable format
+       T_MICRO,                // render as microseconds
+       T_MILLIS,               // render as milliseconds
        T_SECS,
-       T_MINSECS
-} itimemode = T_HUMAN;
+       T_MINUTES,
+       T_PERF,         // return detailed performance
+       T_NONE          // don't render the timing information
+} timermode = T_CLOCK;
 
-static char htimbuf[32];
+static char htimbuf[128];
 static char *
-timerHuman(void)
+timerHuman(int64_t sqloptimizer, int64_t maloptimizer, int64_t querytime)
 {
        timertype t = th - t0;
 
-       assert(th >= t0);
 
-       if (itimemode == T_MILLIS || (itimemode == T_HUMAN && t / 1000 < 950)) {
-               snprintf(htimbuf, sizeof(htimbuf), TTFMT ".%03dms", t / 1000, 
(int) (t % 1000));
+       (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));
+                       return(htimbuf);
+               }
+               t /= 1000;
+               if (t / 1000 < 60) {
+                       snprintf(htimbuf, sizeof(htimbuf), "clk: " TTFMT ".%02d 
sec", t / 1000, (int) ((t % 1000) / 100));
+                       return(htimbuf);
+               }
+               t /= 1000;
+               snprintf(htimbuf, sizeof(htimbuf), "clk: " TTFMT ":%02d min", t 
/ 60, (int) (t % 60));
+               return(htimbuf);
+       }
+       /* for performance measures we use milliseconds as the base */
+       if (timermode == T_PERF){ 
+                       snprintf(htimbuf, sizeof(htimbuf), "clk:%" PRId64 
".%03d sql:%" PRId64 ".%03d opt:%" PRId64 ".%03d run:%" PRId64 ".%03d ms", 
+                       t / 1000, (int)(t % 1000),
+                       sqloptimizer/1000, (int)(sqloptimizer % 1000), 
+                       maloptimizer /1000, (int)(maloptimizer % 1000), 
+                       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 (itimemode == T_SECS || (itimemode == T_HUMAN && t / 1000 < 60)) {
-               snprintf(htimbuf, sizeof(htimbuf), TTFMT ".%ds", t / 1000,
-                               (int) ((t % 1000) / 100));
+       if (timermode == T_SECS ){
+               snprintf(htimbuf, sizeof(htimbuf), TTFMT ".%02d sec", t / 1000, 
(int) ((t % 1000) / 100));
                return(htimbuf);
        }
+       // T_MINUTES
        t /= 1000;
-       /* itimemode == T_MINSECS || itimemode == T_HUMAN */
-       snprintf(htimbuf, sizeof(htimbuf), TTFMT "m %ds", t / 60, (int) (t % 
60));
+       snprintf(htimbuf, sizeof(htimbuf),  TTFMT ".%02d min",t / 60, (int) (t 
% 60));
        return(htimbuf);
 }
 
@@ -568,6 +593,10 @@ SQLrow(int *len, int *numeric, char **re
        size_t ulen;
        int *cutafter = malloc(sizeof(int) * fields);
 
+       if (cutafter == NULL){
+               fprintf(stderr,"Malloc for SQLrow failed");
+               exit(2);
+       }
        /* trim the text if needed */
        if (trim == 1) {
                for (i = 0; i < fields; i++) {
@@ -1273,21 +1302,6 @@ TESTrenderer(MapiHdl hdl)
 }
 
 static void
-CLEANrenderer(MapiHdl hdl)
-{
-       char *reply;
-
-       SQLqueryEcho(hdl);
-       while (!mnstr_errnr(toConsole) && (reply = fetch_line(hdl)) != 0) {
-               if (*reply == '%')
-                       continue;
-               if (*reply == '=')
-                       reply++;
-               mnstr_printf(toConsole, "%s\n", reply);
-       }
-}
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to