Changeset: b8be1823eb29 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b8be1823eb29 Modified Files: buildtools/ChangeLog.Jul2017 clients/Tests/mclient-uri.SQL.sh clients/mapiclient/mclient.c gdk/gdk_batop.c gdk/gdk_project.c monetdb5/optimizer/opt_pushselect.c sql/backends/monet5/sql_cat.c sql/server/rel_psm.c sql/server/rel_schema.c sql/server/sql_mvc.c sql/server/sql_mvc.h sql/storage/sql_storage.h sql/storage/store.c Branch: default Log Message:
Merge with Mar2018 branch. diffs (truncated from 1556 to 300 lines): diff --git a/buildtools/ChangeLog.Jul2017 b/buildtools/ChangeLog.Jul2017 --- a/buildtools/ChangeLog.Jul2017 +++ b/buildtools/ChangeLog.Jul2017 @@ -1,3 +1,7 @@ # ChangeLog file for buildtools # This file is updated with Maddlog +* Mon Feb 12 2018 Sjoerd Mullender <sjo...@acm.org> +- Added the .pdb files needed for debug symbols to the Windows installer + for MonetDB/SQL. + 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,7 +2,7 @@ # test the URI parsing capabilities of the MAPI library -Mlog "mclient -d mapi:monetdb://$HOST:$MAPIPORT/$TSTDB?language=sql&user=monetdb -f test -t none-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 -t none -E utf-8 -s select 1" diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -88,9 +88,8 @@ enum formatters { 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 + TRASHformatter, // remove the result set SAMformatter, // render a SAM result set EXPANDEDformatter // render as multi-row single record }; @@ -127,8 +126,8 @@ static char *pager = 0; /* use external static int rowsperpage = 0; /* for SQL pagination */ static int pagewidth = 0; /* -1: take whatever is necessary, >0: limit */ static int pagewidthset = 0; /* whether the user set the width explicitly */ -static int croppedfields = 0; /* whatever got cropped/truncated */ -static char firstcrop = 1; /* first time we see cropping/truncation */ +static int croppedfields = 0; /* whatever got cropped/truncated */ +static char firstcrop = 1; /* first time we see cropping/truncation */ enum modifiers { NOmodifier, @@ -268,33 +267,31 @@ timerHuman(int64_t sqloptimizer, int64_t { timertype t = th - t0; - - (void) sqloptimizer; - if (timermode == T_CLOCK){ - if( t / 1000 < 950) { + if (timermode == T_CLOCK) { + if (t / 1000 < 950) { snprintf(htimbuf, sizeof(htimbuf), "clk: " TTFMT ".%03d ms" , t / 1000, (int) (t % 1000)); - return(htimbuf); + return htimbuf; } t /= 1000; if (t / 1000 < 60) { snprintf(htimbuf, sizeof(htimbuf), "clk: " TTFMT ".%02d sec", t / 1000, (int) ((t % 1000) / 100)); - return(htimbuf); + return htimbuf; } t /= 1000; snprintf(htimbuf, sizeof(htimbuf), "clk: " TTFMT ":%02d min", t / 60, (int) (t % 60)); - return(htimbuf); + 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); + 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; } htimbuf[0] = 0; - return(htimbuf); + return htimbuf; } /* The Mapi library eats away the comment lines, which we need to @@ -555,7 +552,7 @@ SQLrow(int *len, int *numeric, char **re size_t ulen; int *cutafter = malloc(sizeof(int) * fields); - if (cutafter == NULL){ + if (cutafter == NULL) { fprintf(stderr,"Malloc for SQLrow failed"); exit(2); } @@ -580,8 +577,8 @@ SQLrow(int *len, int *numeric, char **re for (i = 0; i < fields; i++) { if (rest[i] == NULL || *rest[i] == 0) { mnstr_printf(toConsole, "%c %*s ", - first ? '|' : i > 0 && cutafter[i - 1] == 0 ? '>' : ':', - len[i], ""); + first ? '|' : i > 0 && cutafter[i - 1] == 0 ? '>' : ':', + len[i], ""); } else { ulen = utf8strlen(rest[i], NULL); @@ -678,7 +675,7 @@ SQLrow(int *len, int *numeric, char **re more = 1; } else { mnstr_printf(toConsole, "%c", - first ? '|' : i > 0 && cutafter[i - 1] == 0 ? '>' : ':'); + first ? '|' : i > 0 && cutafter[i - 1] == 0 ? '>' : ':'); if (numeric[i]) { mnstr_printf(toConsole, "%*s", (int) (len[i] - ulen), @@ -712,8 +709,8 @@ SQLrow(int *len, int *numeric, char **re } } mnstr_printf(toConsole, "%c%s\n", - first ? '|' : i > 0 && cutafter[i - 1] == 0 ? '>' : ':', - wm ? ">" : ""); + first ? '|' : i > 0 && cutafter[i - 1] == 0 ? '>' : ':', + wm ? ">" : ""); first = 0; rows++; } while (more); @@ -1354,7 +1351,7 @@ SQLheader(MapiHdl hdl, int *len, int fie char **names = (char **) malloc(fields * sizeof(char *)); int *numeric = (int *) malloc(fields * sizeof(int)); - if (names == NULL || numeric == NULL){ + if (names == NULL || numeric == NULL) { free(names); free(numeric); fprintf(stderr,"Malloc for SQLheader failed"); @@ -1438,7 +1435,7 @@ SQLrenderer(MapiHdl hdl, char singleinst hdr = calloc(fields, sizeof(*hdr)); rest = calloc(fields, sizeof(*rest)); numeric = calloc(fields, sizeof(*numeric)); - if(len == NULL || hdr == NULL || rest == NULL || numeric == NULL) { + if (len == NULL || hdr == NULL || rest == NULL || numeric == NULL) { free(len); free(hdr); free(rest); @@ -1544,7 +1541,7 @@ SQLrenderer(MapiHdl hdl, char singleinst for (i = 0; i < printfields; i++) { if (hdr[i] > len[i]) { if (max == -1 || - hdr[max] - len[max] < hdr[i] - len[i]) + hdr[max] - len[max] < hdr[i] - len[i]) max = i; } } @@ -1589,8 +1586,8 @@ SQLrenderer(MapiHdl hdl, char singleinst continue; if (rfields != fields) { mnstr_printf(stderr_stream, - "invalid tuple received from server, " - "got %d columns, expected %d, ignoring\n", rfields, fields); + "invalid tuple received from server, " + "got %d columns, expected %d, ignoring\n", rfields, fields); continue; } if (silent) @@ -1647,7 +1644,7 @@ SQLrenderer(MapiHdl hdl, char singleinst printf(", "); if (croppedfields > 0) printf("%d field%s truncated", - croppedfields, croppedfields != 1 ? "s" : ""); + croppedfields, croppedfields != 1 ? "s" : ""); if (fields != printfields || croppedfields > 0) { printf("!"); if (firstcrop == 1) { @@ -1703,8 +1700,6 @@ setFormatter(const char *s) formatter = RAWformatter; } else if (strcmp(s, "xml") == 0) { formatter = XMLformatter; - } else if (strcmp(s, "json") == 0) { - formatter = JSONformatter; } else if (strcmp(s, "test") == 0) { #ifdef _TWO_DIGIT_EXPONENT _set_output_format(_TWO_DIGIT_EXPONENT); @@ -1733,11 +1728,13 @@ setWidth(void) pagewidth = ws.ws_col; else #endif + { #ifdef WIN32 pagewidth = 79; /* 80 columns minus 1 for the edge */ #else pagewidth = -1; #endif + } } } @@ -1763,14 +1760,14 @@ start_pager(stream **saveFD) else { *saveFD = toConsole; /* put | in name to indicate that file should be closed with pclose */ - if((toConsole = file_wastream(p, "|pager")) == NULL) { + if ((toConsole = file_wastream(p, "|pager")) == NULL) { toConsole = *saveFD; *saveFD = NULL; fprintf(stderr, "Starting '%s' failed\n", pager); } #ifdef HAVE_ICONV if (encoding != NULL) { - if((toConsole = iconv_wstream(toConsole, encoding, "pager")) == NULL) { + if ((toConsole = iconv_wstream(toConsole, encoding, "pager")) == NULL) { toConsole = *saveFD; *saveFD = NULL; fprintf(stderr, "Starting '%s' failed\n", pager); @@ -1812,7 +1809,7 @@ format_result(Mapi mid, MapiHdl hdl, cha /* handle errors first */ if (mapi_result_error(hdl) != NULL) { mnstr_flush(toConsole); - if (formatter == TABLEformatter ) { + if (formatter == TABLEformatter) { mapi_noexplain(mid, ""); } else { mapi_noexplain(mid, NULL); @@ -1839,7 +1836,7 @@ format_result(Mapi mid, MapiHdl hdl, cha if (formatter == RAWformatter || formatter == TESTformatter) mnstr_printf(toConsole, "[ %" PRId64 "\t]\n", mapi_rows_affected(hdl)); - else if (formatter == TRASHformatter){ + else if (formatter == TRASHformatter) { mapi_next_result(hdl); printf("%s\n", timerHuman(sqloptimizer, maloptimizer, querytime)); } else { @@ -1865,11 +1862,11 @@ format_result(Mapi mid, MapiHdl hdl, cha SQLqueryEcho(hdl); if (formatter == TABLEformatter) { mnstr_printf(toConsole, "operation successful"); - if (singleinstr && timermode != T_NONE) + if (singleinstr && timermode != T_NONE) mnstr_printf(toConsole, " (%s)", timerHuman(sqloptimizer, maloptimizer, querytime)); mnstr_printf(toConsole, "\n"); - } else if (formatter == TRASHformatter){ + } else if (formatter == TRASHformatter) { mapi_next_result(hdl); printf("%s\n", timerHuman(sqloptimizer, maloptimizer, querytime)); } @@ -1928,6 +1925,8 @@ format_result(Mapi mid, MapiHdl hdl, cha else { char *s; switch (formatter) { + case TRASHformatter: + break; case XMLformatter: XMLrenderer(hdl); break; @@ -1953,9 +1952,9 @@ format_result(Mapi mid, MapiHdl hdl, cha case EXPANDEDformatter: EXPANDEDrenderer(hdl); break; - default: - if ( formatter != TRASHformatter) - RAWrenderer(hdl); + default: + RAWrenderer(hdl); + break; } s= timerHuman(sqloptimizer, maloptimizer, querytime); if (*s) @@ -1984,7 +1983,7 @@ doRequest(Mapi mid, const char *buf) hdl = mapi_query(mid, buf); if (hdl == NULL) { - if (formatter == TABLEformatter ) { + if (formatter == TABLEformatter) { mapi_noexplain(mid, ""); } else { mapi_noexplain(mid, NULL); @@ -2004,47 +2003,47 @@ doRequest(Mapi mid, const char *buf) return 0; } -#define CHECK_RESULT(mid, hdl, break_or_continue, buf, fp) \ - switch (mapi_error(mid)) { \ - case MOK: \ - /* everything A OK */ \ - break; \ - case MERROR: \ - /* some error, but try to continue */ \ - if (formatter == TABLEformatter ) { \ - mapi_noexplain(mid, ""); \ - } else { \ - mapi_noexplain(mid, NULL); \ _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list