Changeset: 1fdcd2a61a5a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1fdcd2a61a5a
Added Files:
sql/test/Tests/sysqueue.sql
sql/test/Tests/sysqueue.stable.err
sql/test/Tests/sysqueue.stable.out
Removed Files:
sql/test/BugTracker-2020/Tests/sysqueue.sql
sql/test/BugTracker-2020/Tests/sysqueue.stable.err
sql/test/BugTracker-2020/Tests/sysqueue.stable.out
Modified Files:
clients/mapilib/mapi.c
gdk/gdk_aggr.c
gdk/gdk_analytic_func.c
gdk/gdk_select.c
sql/backends/monet5/UDF/pyapi3/connection3.c
sql/backends/monet5/UDF/pyapi3/emit3.c
sql/server/rel_optimizer.c
sql/server/rel_psm.c
sql/server/rel_select.c
sql/server/rel_updates.c
sql/storage/store.c
sql/test/BugTracker-2016/Tests/ifthenelse-void.Bug-6075.sql
sql/test/BugTracker-2017/Tests/sqlsmith02.sql
sql/test/BugTracker-2020/Tests/All
sql/test/Tests/All
sql/test/mergetables/Tests/sqlsmith-exists2.sql
sql/test/mergetables/Tests/sqlsmith-exists2.stable.out
sql/test/miscellaneous/Tests/groupby_error.sql
sql/test/miscellaneous/Tests/groupby_error.stable.out
sql/test/subquery/Tests/subquery5.sql
sql/test/subquery/Tests/subquery5.stable.err
sql/test/subquery/Tests/subquery5.stable.out
Branch: scoping
Log Message:
Merged with default
diffs (truncated from 1541 to 300 lines):
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -1000,13 +1000,13 @@ static void mapi_store_bind(struct MapiR
static ATOMIC_FLAG mapi_initialized = ATOMIC_FLAG_INIT;
-#define check_stream(mid,s,msg,f,e) \
+#define check_stream(mid, s, msg, e) \
do { \
if ((s) == NULL || mnstr_errnr(s)) { \
- mapi_log_record(mid,msg); \
- mapi_log_record(mid,f); \
+ mapi_log_record(mid, msg); \
+ mapi_log_record(mid, __func__); \
close_connection(mid); \
- mapi_setError((mid), (msg), (f), MTIMEOUT); \
+ mapi_setError((mid), (msg), __func__, MTIMEOUT); \
return (e); \
} \
} while (0)
@@ -1420,7 +1420,7 @@ mapi_log(Mapi mid, const char *nme)
if (mid->tracelog)
close_stream(mid->tracelog);
mid->tracelog = NULL;
- return mapi_setError(mid, "Could not create log file",
"mapi_log", MERROR);
+ return mapi_setError(mid, "Could not create log file",
__func__, MERROR);
}
return MOK;
}
@@ -1529,7 +1529,7 @@ close_result(MapiHdl hdl)
if (mnstr_printf(mid->to, "%s", msg) < 0 ||
mnstr_flush(mid->to)) {
close_connection(mid);
- mapi_setError(mid,
mnstr_error(mid->to), "mapi_close_handle", MTIMEOUT);
+ mapi_setError(mid,
mnstr_error(mid->to), __func__, MTIMEOUT);
break;
}
read_into_cache(hdl, 0);
@@ -1547,7 +1547,7 @@ close_result(MapiHdl hdl)
if (mnstr_printf(mid->to, "%s", msg) < 0 ||
mnstr_flush(mid->to)) {
close_connection(mid);
- mapi_setError(mid,
mnstr_error(mid->to), "mapi_close_handle", MTIMEOUT);
+ mapi_setError(mid,
mnstr_error(mid->to), __func__, MTIMEOUT);
} else
read_into_cache(hdl, 0);
}
@@ -1725,7 +1725,7 @@ mapi_new_handle(Mapi mid)
hdl = malloc(sizeof(*hdl));
if (hdl == NULL) {
- mapi_setError(mid, "Memory allocation failure",
"mapi_new_handle", MERROR);
+ mapi_setError(mid, "Memory allocation failure", __func__,
MERROR);
return NULL;
}
*hdl = (struct MapiStatement) {
@@ -1759,7 +1759,7 @@ finish_handle(MapiHdl hdl)
hdl->needmore = false;
mid->active = hdl;
mnstr_flush(mid->to);
- check_stream(mid, mid->to, "write error on stream",
"finish_handle", mid->error);
+ check_stream(mid, mid->to, "write error on stream",
mid->error);
read_into_cache(hdl, 0);
}
for (i = 0; i < hdl->npending_close; i++) {
@@ -1771,7 +1771,7 @@ finish_handle(MapiHdl hdl)
if (mnstr_printf(mid->to, "%s", msg) < 0 ||
mnstr_flush(mid->to)) {
close_connection(mid);
- mapi_setError(mid, mnstr_error(mid->to),
"finish_handle", MTIMEOUT);
+ mapi_setError(mid, mnstr_error(mid->to),
__func__, MTIMEOUT);
break;
}
read_into_cache(hdl, 0);
@@ -1789,7 +1789,7 @@ finish_handle(MapiHdl hdl)
hdl->needmore = false;
mid->active = hdl;
mnstr_flush(mid->to);
- check_stream(mid, mid->to, "write error on stream",
"finish_handle", mid->error);
+ check_stream(mid, mid->to, "write error on stream",
mid->error);
read_into_cache(hdl, 0);
}
}
@@ -1970,19 +1970,19 @@ mapi_mapiuri(const char *url, const char
return NULL;
if (url == NULL) {
- mapi_setError(mid, "url is null", "mapi_mapiuri", MERROR);
+ mapi_setError(mid, "url is null", __func__, MERROR);
return mid;
}
if (user == NULL) {
- mapi_setError(mid, "user is null", "mapi_mapiuri", MERROR);
+ mapi_setError(mid, "user is null", __func__, MERROR);
return mid;
}
if (pass == NULL) {
- mapi_setError(mid, "pass is null", "mapi_mapiuri", MERROR);
+ mapi_setError(mid, "pass is null", __func__, MERROR);
return mid;
}
if (lang == NULL) {
- mapi_setError(mid, "lang is null", "mapi_mapiuri", MERROR);
+ mapi_setError(mid, "lang is null", __func__, MERROR);
return mid;
}
@@ -2002,7 +2002,7 @@ mapi_mapiuri(const char *url, const char
mapi_setError(mid,
"url has unsupported scheme, "
"expecting mapi:monetdb://...",
- "mapi_mapiuri", MERROR);
+ __func__, MERROR);
return mid;
}
if ((uri = strdup(url + sizeof("mapi:monetdb://") - 1)) == NULL) {
@@ -2027,7 +2027,7 @@ mapi_mapiuri(const char *url, const char
if (*p == '[') {
if ((p = strchr(p, ']')) == NULL) {
free(uri);
- mapi_setError(mid, "URI contains an invalid
IPv6 address", "mapi_mapiuri", MERROR);
+ mapi_setError(mid, "URI contains an invalid
IPv6 address", __func__, MERROR);
return mid;
}
}
@@ -2036,7 +2036,7 @@ mapi_mapiuri(const char *url, const char
mapi_setError(mid,
"URI must contain a port number after "
"the hostname",
- "mapi_mapiuri", MERROR);
+ __func__, MERROR);
return mid;
}
*p++ = 0;
@@ -2052,7 +2052,7 @@ mapi_mapiuri(const char *url, const char
free(uri);
mapi_setError(mid,
"URI contains invalid port",
- "mapi_mapiuri", MERROR);
+ __func__, MERROR);
return mid;
}
query = dbname;
@@ -2356,7 +2356,7 @@ mapi_reconnect(Mapi mid)
struct sockaddr *serv = (struct sockaddr *) &userver;
if (strlen(mid->hostname) >= sizeof(userver.sun_path)) {
- return mapi_setError(mid, "path name too long",
"mapi_reconnect", MERROR);
+ return mapi_setError(mid, "path name too long",
__func__, MERROR);
}
if ((s = socket(PF_UNIX, SOCK_STREAM
@@ -2372,7 +2372,7 @@ mapi_reconnect(Mapi mid)
strerror(errno)
#endif
);
- return mapi_setError(mid, errbuf, "mapi_reconnect",
MERROR);
+ return mapi_setError(mid, errbuf, __func__, MERROR);
}
#if !defined(SOCK_CLOEXEC) && defined(HAVE_FCNTL)
(void) fcntl(s, F_SETFD, FD_CLOEXEC);
@@ -2392,7 +2392,7 @@ mapi_reconnect(Mapi mid)
#endif
);
closesocket(s);
- return mapi_setError(mid, errbuf, "mapi_reconnect",
MERROR);
+ return mapi_setError(mid, errbuf, __func__, MERROR);
}
/* send first byte, nothing special to happen */
@@ -2416,7 +2416,7 @@ mapi_reconnect(Mapi mid)
#endif
);
closesocket(s);
- return mapi_setError(mid, errbuf, "mapi_reconnect",
MERROR);
+ return mapi_setError(mid, errbuf, __func__, MERROR);
}
} else
#endif
@@ -2438,7 +2438,7 @@ mapi_reconnect(Mapi mid)
ret = getaddrinfo(mid->hostname, port, &hints, &res);
if (ret) {
snprintf(errbuf, sizeof(errbuf), "getaddrinfo failed:
%s", gai_strerror(ret));
- return mapi_setError(mid, errbuf, "mapi_reconnect",
MERROR);
+ return mapi_setError(mid, errbuf, __func__, MERROR);
}
errbuf[0] = 0;
for (rp = res; rp; rp = rp->ai_next) {
@@ -2472,7 +2472,7 @@ mapi_reconnect(Mapi mid)
snprintf(errbuf, sizeof(errbuf),
"getaddrinfo succeeded but did not
return a result");
}
- return mapi_setError(mid, errbuf, "mapi_reconnect",
MERROR);
+ return mapi_setError(mid, errbuf, __func__, MERROR);
}
#else
struct sockaddr_in server;
@@ -2490,7 +2490,7 @@ mapi_reconnect(Mapi mid)
errno ? strerror(errno) : hstrerror(h_errno)
#endif
);
- return mapi_setError(mid, errbuf, "mapi_reconnect",
MERROR);
+ return mapi_setError(mid, errbuf, __func__, MERROR);
}
server = (struct sockaddr_in) {
.sin_family = hp->h_addrtype,
@@ -2511,7 +2511,7 @@ mapi_reconnect(Mapi mid)
strerror(errno)
#endif
);
- return mapi_setError(mid, errbuf, "mapi_reconnect",
MERROR);
+ return mapi_setError(mid, errbuf, __func__, MERROR);
}
#if !defined(SOCK_CLOEXEC) && defined(HAVE_FCNTL)
(void) fcntl(s, F_SETFD, FD_CLOEXEC);
@@ -2526,7 +2526,7 @@ mapi_reconnect(Mapi mid)
strerror(errno)
#endif
);
- return mapi_setError(mid, errbuf, "mapi_reconnect",
MERROR);
+ return mapi_setError(mid, errbuf, __func__, MERROR);
}
#endif
/* compare our own address with that of our peer and
@@ -2545,7 +2545,7 @@ mapi_reconnect(Mapi mid)
myaddr.i.sin_port == praddr.i.sin_port) {
closesocket(s);
return mapi_setError(mid, "connected to self",
- "mapi_reconnect", MERROR);
+ __func__, MERROR);
}
}
@@ -2553,17 +2553,17 @@ mapi_reconnect(Mapi mid)
mapi_log_record(mid, "Mapi client write");
mid->from = socket_rstream(s, "Mapi client read");
mapi_log_record(mid, "Mapi client read");
- check_stream(mid, mid->to, "Cannot open socket for writing",
"mapi_reconnect", mid->error);
- check_stream(mid, mid->from, "Cannot open socket for reading",
"mapi_reconnect", mid->error);
+ check_stream(mid, mid->to, "Cannot open socket for writing",
mid->error);
+ check_stream(mid, mid->from, "Cannot open socket for reading",
mid->error);
mid->connected = true;
if (!isa_block_stream(mid->to)) {
mid->to = block_stream(mid->to);
- check_stream(mid, mid->to, mnstr_error(mid->to),
"mapi_reconnect", mid->error);
+ check_stream(mid, mid->to, mnstr_error(mid->to), mid->error);
mid->from = block_stream(mid->from);
- check_stream(mid, mid->from, mnstr_error(mid->from),
"mapi_reconnect", mid->error);
+ check_stream(mid, mid->from, mnstr_error(mid->from),
mid->error);
}
try_again_after_redirect:
@@ -2571,27 +2571,27 @@ mapi_reconnect(Mapi mid)
/* consume server challenge */
len = mnstr_read_block(mid->from, buf, 1, sizeof(buf));
- check_stream(mid, mid->from, "Connection terminated while starting",
"mapi_reconnect", (mid->blk.eos = true, mid->error));
+ check_stream(mid, mid->from, "Connection terminated while starting",
(mid->blk.eos = true, mid->error));
assert(len < sizeof(buf));
buf[len] = 0;
if (len == 0) {
- mapi_setError(mid, "Challenge string is not valid, it is
empty", "mapi_start_talking", MERROR);
+ mapi_setError(mid, "Challenge string is not valid, it is
empty", __func__, MERROR);
return mid->error;
}
/* buf at this point looks like "challenge:servertype:protover[:.*]" */
chal = buf;
server = strchr(chal, ':');
if (server == NULL) {
- mapi_setError(mid, "Challenge string is not valid, server not
found", "mapi_reconnect", MERROR);
+ mapi_setError(mid, "Challenge string is not valid, server not
found", __func__, MERROR);
close_connection(mid);
return mid->error;
}
*server++ = '\0';
protover = strchr(server, ':');
if (protover == NULL) {
- mapi_setError(mid, "Challenge string is not valid, protocol not
found", "mapi_reconnect", MERROR);
+ mapi_setError(mid, "Challenge string is not valid, protocol not
found", __func__, MERROR);
close_connection(mid);
return mid->error;
}
@@ -2626,7 +2626,7 @@ mapi_reconnect(Mapi mid)
if (mid->username == NULL || mid->password == NULL) {
mapi_setError(mid, "username and password must be set",
- "mapi_reconnect", MERROR);
+ __func__, MERROR);
close_connection(mid);
return mid->error;
}
@@ -2637,7 +2637,7 @@ mapi_reconnect(Mapi mid)
if (rest == NULL) {
/* protocol violation, not enough fields */
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list