Changeset: e5190ed74614 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e5190ed74614
Added Files:
sql/test/BugTracker-2018/Tests/aggr-in-case.Bug-6526.stable.out.int128
sql/test/BugTracker-2018/Tests/ilike.Bug-6547.sql
sql/test/BugTracker-2018/Tests/ilike.Bug-6547.stable.err
sql/test/BugTracker-2018/Tests/ilike.Bug-6547.stable.out
sql/test/BugTracker-2018/Tests/truncate_add_user.sql
sql/test/BugTracker-2018/Tests/truncate_add_user.stable.err
sql/test/BugTracker-2018/Tests/truncate_add_user.stable.out
sql/test/BugTracker-2018/Tests/truncate_bam_tables.Bug-6543.reqtests
sql/test/BugTracker-2018/Tests/truncate_remove_user.sql
sql/test/BugTracker-2018/Tests/truncate_remove_user.stable.err
sql/test/BugTracker-2018/Tests/truncate_remove_user.stable.out
sql/test/BugTracker-2018/Tests/truncate_sys_netcdf_tables.Bug-6543.reqtests
sql/test/BugTracker-2018/Tests/truncate_sys_tables.Bug-6543.reqtests
sql/test/BugTracker/Tests/mapi_connect_errors_vanish.SF-1432134.sql
Removed Files:
sql/test/BugTracker-2016/Tests/storagemodel.stable.out.Darwin
sql/test/BugTracker-2016/Tests/storagemodel.stable.out.FreeBSD
sql/test/BugTracker-2016/Tests/storagemodel.stable.out.Windows
sql/test/BugTracker/Tests/mapi_connect_errors_vanish.SF-1432134.SQL.py
Modified Files:
clients/mapiclient/mclient.c
clients/odbc/setup/drvcfg.h
gdk/gdk.h
gdk/gdk_bat.c
gdk/gdk_batop.c
monetdb5/mal/mal_readline.c
monetdb5/modules/mal/pcre.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_upgrades.c
sql/backends/monet5/vaults/bam/85_bam.sql
sql/backends/monet5/vaults/netcdf/74_netcdf.sql
sql/scripts/97_comments.sql
sql/server/rel_schema.c
sql/server/rel_updates.c
sql/test/BugTracker-2016/Tests/storagemodel.sql
sql/test/BugTracker-2016/Tests/storagemodel.stable.out
sql/test/BugTracker-2018/Tests/All
sql/test/BugTracker-2018/Tests/aggr-in-case.Bug-6526.stable.out
sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.sql
sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.stable.out
sql/test/BugTracker/Tests/All
sql/test/Tests/comment-auth.stable.err
sql/test/Tests/comment-auth.stable.out
sql/test/Tests/comment-on.stable.out
sql/test/Tests/systemfunctions.stable.out
sql/test/Tests/systemfunctions.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade/Tests/upgrade.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/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
testing/Mtest.py.in
Branch: configurable_working_set
Log Message:
Merge with default branch.
diffs (truncated from 4022 to 300 lines):
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -71,11 +71,11 @@ static stream *fromConsole = NULL;
static char *language = NULL;
static char *logfile = NULL;
static char promptbuf[16];
-static int echoquery = 0;
+static bool echoquery = false;
#ifdef HAVE_ICONV
static char *encoding;
#endif
-static int errseen = 0;
+static bool errseen = false;
#define setPrompt() sprintf(promptbuf, "%.*s>", (int) sizeof(promptbuf) - 2,
language)
#define debugMode() (strncmp(promptbuf, "mdb", 3) == 0)
@@ -94,7 +94,7 @@ enum formatters {
};
static enum formatters formatter = NOformatter;
char *separator = NULL; /* column separator for CSV/TAB format
*/
-int csvheader = 0; /* include header line in CSV format */
+bool csvheader = false; /* include header line in CSV format */
#define DEFWIDTH 80
@@ -123,9 +123,9 @@ static char *pager = 0; /* use external
#endif
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 bool pagewidthset = false; /* 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 bool firstcrop = true; /* first time we see cropping/truncation */
enum modifiers {
NOmodifier,
@@ -259,13 +259,13 @@ static enum itimers {
T_PERF // return detailed performance
} timermode = T_NONE;
-static int timerHumanCalled = 0;
+static bool timerHumanCalled = false;
static void
timerHuman(int64_t sqloptimizer, int64_t maloptimizer, int64_t querytime, int
singleinstr, int total)
{
timertype t = th - t0;
- timerHumanCalled = 1;
+ timerHumanCalled = true;
/*
* report only the times we do actually measure:
@@ -571,7 +571,8 @@ utf8skip(char *s, size_t i)
static int
SQLrow(int *len, int *numeric, char **rest, int fields, int trim, char wm)
{
- int i, more, first = 1;
+ int i;
+ bool more, first = true;
char *t;
int rows = 0; /* return number of output lines printed */
size_t ulen;
@@ -598,7 +599,7 @@ SQLrow(int *len, int *numeric, char **re
cutafter[i] = -1;
do {
- more = 0;
+ more = false;
for (i = 0; i < fields; i++) {
if (rest[i] == NULL || *rest[i] == 0) {
mnstr_printf(toConsole, "%c %*s ",
@@ -697,7 +698,7 @@ SQLrow(int *len, int *numeric, char **re
if (cutafter[i] == 0)
rest[i] = NULL;
if (rest[i])
- more = 1;
+ more = true;
} else {
mnstr_printf(toConsole, "%c",
first ? '|' : i > 0 &&
cutafter[i - 1] == 0 ? '>' : ':');
@@ -736,7 +737,7 @@ SQLrow(int *len, int *numeric, char **re
mnstr_printf(toConsole, "%c%s\n",
first ? '|' : i > 0 && cutafter[i - 1] == 0 ? '>'
: ':',
wm ? ">" : "");
- first = 0;
+ first = false;
rows++;
} while (more);
@@ -1414,7 +1415,7 @@ SQLdebugRendering(MapiHdl hdl)
}
static void
-SQLpagemove(int *len, int fields, int *ps, int *silent)
+SQLpagemove(int *len, int fields, int *ps, bool *silent)
{
char buf[512];
ssize_t sz;
@@ -1427,11 +1428,11 @@ SQLpagemove(int *len, int fields, int *p
if (buf[0] == 'c')
*ps = 0;
if (buf[0] == 'q')
- *silent = 1;
+ *silent = true;
while (sz > 0 && buf[sz - 1] != '\n')
sz = mnstr_readline(fromConsole, buf, sizeof(buf));
}
- if (*silent == 0)
+ if (!*silent)
SQLseparator(len, fields, '-');
}
@@ -1443,7 +1444,8 @@ SQLrenderer(MapiHdl hdl)
int *len = NULL, *hdr = NULL, *numeric = NULL;
char **rest = NULL;
char buf[50];
- int ps = rowsperpage, silent = 0;
+ int ps = rowsperpage;
+ bool silent = false;
int64_t rows = 0;
croppedfields = 0;
@@ -1666,8 +1668,8 @@ SQLrenderer(MapiHdl hdl)
croppedfields, croppedfields != 1 ? "s" : "");
if (fields != printfields || croppedfields > 0) {
mnstr_printf(toConsole, "!");
- if (firstcrop == 1) {
- firstcrop = 0;
+ if (firstcrop) {
+ firstcrop = false;
mnstr_printf(toConsole, "\nnote: to disable dropping
columns and/or truncating fields use \\w-1");
}
}
@@ -1685,7 +1687,7 @@ setFormatter(const char *s)
if (separator)
free(separator);
separator = NULL;
- csvheader = 0;
+ csvheader = false;
#ifdef _TWO_DIGIT_EXPONENT
if (formatter == TESTformatter)
_set_output_format(0);
@@ -1711,7 +1713,7 @@ setFormatter(const char *s)
separator[strlen(separator) - 1] = 0;
} else
separator = strdup(s + 4);
- csvheader = 1;
+ csvheader = true;
} else if (strcmp(s, "tab") == 0) {
formatter = CSVformatter;
separator = strdup("\t");
@@ -1823,7 +1825,7 @@ format_result(Mapi mid, MapiHdl hdl, int
setWidth();
- timerHumanCalled = 0;
+ timerHumanCalled = false;
do {
/* handle errors first */
@@ -1835,7 +1837,7 @@ format_result(Mapi mid, MapiHdl hdl, int
mapi_noexplain(mid, NULL);
}
mapi_explain_result(hdl, stderr);
- errseen = 1;
+ errseen = true;
/* don't need to print something like '0
* tuples' if we got an error */
continue;
@@ -1982,7 +1984,7 @@ format_result(Mapi mid, MapiHdl hdl, int
if (mnstr_errnr(toConsole)) {
mnstr_clearerr(toConsole);
fprintf(stderr, "write error\n");
- errseen = 1;
+ errseen = true;
}
#ifdef HAVE_POPEN
end_pager(saveFD);
@@ -2007,7 +2009,7 @@ doRequest(Mapi mid, const char *buf)
mapi_noexplain(mid, NULL);
}
mapi_explain(mid, stderr);
- errseen = 1;
+ errseen = true;
return 1;
}
@@ -2039,7 +2041,7 @@ doRequest(Mapi mid, const char *buf)
hdl = NULL; \
} else \
mapi_explain(mid, stderr); \
- errseen = 1; \
+ errseen = true; \
break_or_continue; \
case MTIMEOUT: \
/* lost contact with the server */ \
@@ -2054,7 +2056,7 @@ doRequest(Mapi mid, const char *buf)
hdl = NULL; \
} else \
mapi_explain(mid, stderr); \
- errseen = 1; \
+ errseen = true; \
timerEnd(); \
if (buf) \
free(buf); \
@@ -2063,7 +2065,7 @@ doRequest(Mapi mid, const char *buf)
return 1; \
}
-static int
+static bool
doFileBulk(Mapi mid, stream *fp)
{
char *buf = NULL;
@@ -2078,7 +2080,7 @@ doFileBulk(Mapi mid, stream *fp)
fprintf(stderr, "cannot allocate memory for send buffer\n");
if (fp)
close_stream(fp);
- return 1;
+ return true;
}
timerStart();
@@ -2099,7 +2101,7 @@ doFileBulk(Mapi mid, stream *fp)
buf[length] = 0;
if (strlen(buf) < (size_t) length) {
fprintf(stderr, "NULL byte in input\n");
- errseen = 1;
+ errseen = true;
break;
}
}
@@ -2259,8 +2261,8 @@ mydestroy(void *private)
}
#endif
-static int
-doFile(Mapi mid, stream *fp, bool useinserts, int interactive, int
save_history)
+static bool
+doFile(Mapi mid, stream *fp, bool useinserts, bool interactive, int
save_history)
{
char *line = NULL;
char *buf = NULL;
@@ -2282,7 +2284,7 @@ doFile(Mapi mid, stream *fp, bool useins
&& formatter != TESTformatter
#endif
) {
- interactive = 1;
+ interactive = true;
setPrompt();
prompt = promptbuf;
fromConsole = fp;
@@ -2318,12 +2320,12 @@ doFile(Mapi mid, stream *fp, bool useins
exit(2);
}
do {
- int seen_null_byte = 0;
+ bool seen_null_byte = false;
if (prompt) {
char *p = hdl ? "more>" : prompt;
/* clear errors when interactive */
- errseen = 0;
+ errseen = false;
#ifdef HAVE_LIBREADLINE
rl.prompt = p;
#else
@@ -2342,8 +2344,8 @@ doFile(Mapi mid, stream *fp, bool useins
break;
if (!seen_null_byte && strlen(buf + length) < (size_t)
l) {
fprintf(stderr, "NULL byte in input on line %d
of input\n", lineno);
- seen_null_byte = 1;
- errseen = 1;
+ seen_null_byte = true;
+ errseen = true;
if (hdl) {
mapi_close_handle(hdl);
hdl = NULL;
@@ -2358,7 +2360,7 @@ doFile(Mapi mid, stream *fp, bool useins
} else {
fprintf(stderr,"Malloc failure");
length = 0;
- errseen = 1;
+ errseen = true;
if (hdl) {
mapi_close_handle(hdl);
hdl = NULL;
@@ -2435,12 +2437,12 @@ doFile(Mapi mid, stream *fp, bool useins
rowsperpage = atoi(line + 2);
continue;
case 'd': {
- char hasWildcard = 0;
- char hasSchema = 0;
- char wantsSystem = 0;
+ bool hasWildcard = false;
+ bool hasSchema = false;
+ bool wantsSystem = false;
unsigned int x = 0;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list