Changeset: 951c6e4984be for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/951c6e4984be
Modified Files:
clients/Tests/MAL-signatures-hge.test
monetdb5/mal/mal_client.h
monetdb5/modules/mal/calc.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_result.c
testing/melcheck.py
testing/sqllogictest.py
Branch: pp_hashjoin
Log Message:
merged from default
diffs (truncated from 1430 to 300 lines):
diff --git a/clients/Tests/MAL-signatures-hge.test
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -3489,11 +3489,6 @@ unsafe pattern alarm.sleep(X_0:any_1):an
ALARMsleep
Sleep a few milliseconds and return the slept value
alarm
-sleep
-unsafe pattern alarm.sleep(X_0:any_1):void
-ALARMsleep
-Sleep a few milliseconds
-alarm
time
unsafe command alarm.time():int
ALARMtime
@@ -31005,16 +31000,6 @@ CMDconvertsignal_str
(empty)
batcalc
str
-command batcalc.str(X_0:bat[:inet4], X_1:bat[:oid]):bat[:str]
-INETinet42str_bulk
-Coerce an inet4 to a string type
-batcalc
-str
-command batcalc.str(X_0:bat[:inet6], X_1:bat[:oid]):bat[:str]
-INETinet62str_bulk
-Coerce an inet6 to a string type
-batcalc
-str
pattern batcalc.str(X_0:int, X_1:int, X_2:int, X_3:int, X_4:bat[:any_1],
X_5:bat[:oid], X_6:int):bat[:str]
SQLbatstr_cast
cast to string and check for overflow
@@ -31024,11 +31009,6 @@ pattern batcalc.str(X_0:int, X_1:int, X_
SQLbatstr_cast
cast to string and check for overflow, no candidate list
batcalc
-str
-command batcalc.str(X_0:bat[:uuid], X_1:bat[:oid]):bat[:str]
-UUIDuuid2str_bulk
-Coerce a uuid to a string type
-batcalc
timestamp
pattern batcalc.timestamp(X_0:bat[:date], X_1:bat[:oid]):bat[:timestamp]
MTIMEtimestamp_fromdate_bulk
@@ -45180,25 +45160,10 @@ CMDvarCONVERT
Cast VALUE to str
calc
str
-command calc.str(X_0:inet4):str
-INETinet42str
-Coerce an inet4 to a string type
-calc
-str
-command calc.str(X_0:inet6):str
-INETinet62str
-Coerce an inet6 to a string type
-calc
-str
pattern calc.str(X_0:int, X_1:int, X_2:int, X_3:int, X_4:any_1, X_5:int):str
SQLstr_cast
cast to string and check for overflow
calc
-str
-command calc.str(X_0:uuid):str
-UUIDuuid2str
-Coerce a uuid to a string type
-calc
timestamp
command calc.timestamp(X_0:date):timestamp
MTIMEtimestamp_fromdate
diff --git a/clients/Tests/melcheck.sh b/clients/Tests/melcheck.sh
--- a/clients/Tests/melcheck.sh
+++ b/clients/Tests/melcheck.sh
@@ -9,4 +9,4 @@ if [ "$hg_root" = "$TSTSRCBASE" ]; then
elif [ "$git_root" = "$TSTSRCBASE" ]; then
git ls-files -- 'monetdb5/**.[ch]' 'sql/**.[ch]' 'geom/**.[ch]'
':!:**/Tests/*'
fi \
-| python3 -c 'import MonetDBtesting.melcheck'
+| python3 -m MonetDBtesting.melcheck # --match-any
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -165,6 +165,12 @@ static char *nullstring = default_nullst
#include "mhelp.h"
#include "mutf8.h"
+#if SIZEOF_VOID_P == 4
+#define CACHELIMIT 1000
+#else
+#define CACHELIMIT 5000
+#endif
+
static timertype
gettime(void)
{
@@ -320,37 +326,6 @@ static char *encoding;
#include "iconv-stream.h"
#endif
-/* The Mapi library eats away the comment lines, which we need to
- * detect end of debugging. We overload the routine to our liking. */
-
-static char *
-fetch_line(MapiHdl hdl)
-{
- char *reply;
-
- if ((reply = mapi_fetch_line(hdl)) == NULL)
- return NULL;
- if (strncmp(reply, "mdb>#", 5) == 0) {
- if (strncmp(reply, "mdb>#EOD", 8) == 0)
- setPrompt();
- else
- snprintf(promptbuf, sizeof(promptbuf), "mdb>");
- }
- return reply;
-}
-
-static int
-fetch_row(MapiHdl hdl)
-{
- char *reply;
-
- do {
- if ((reply = fetch_line(hdl)) == NULL)
- return 0;
- } while (*reply != '[' && *reply != '=');
- return mapi_split_line(hdl);
-}
-
static void
SQLsetSpecial(const char *command)
{
@@ -395,7 +370,7 @@ utf8strlenmax(char *s, char *e, size_t m
} else if (codepoint <= 0x1F || codepoint == 0177) {
len += 4; /* control, rendered as
"\\%03o" */
} else if (0x80 <= codepoint && codepoint <= 0x9F) {
- len += 6; /* control, rendered as
"u\\%04x" */
+ len += 6; /* control, rendered as
"\\u%04x" */
} else {
/* charwidth() returning -1 is caught by the
above */
len += charwidth(codepoint);
@@ -738,7 +713,7 @@ XMLrenderer(MapiHdl hdl)
if (name != NULL && *name != 0)
XMLprattr("name", name);
mnstr_printf(toConsole, ">\n");
- while (mnstr_errnr(toConsole) == MNSTR_NO__ERROR && (fields =
fetch_row(hdl)) != 0) {
+ while (mnstr_errnr(toConsole) == MNSTR_NO__ERROR && (fields =
mapi_fetch_row(hdl)) != 0) {
mnstr_printf(toConsole, "<row>");
for (i = 0; i < fields; i++) {
char *data = mapi_fetch_field(hdl, i);
@@ -775,7 +750,7 @@ EXPANDEDrenderer(MapiHdl hdl)
if (w > fieldw)
fieldw = w;
}
- while (mnstr_errnr(toConsole) == MNSTR_NO__ERROR && (fields =
fetch_row(hdl)) != 0) {
+ while (mnstr_errnr(toConsole) == MNSTR_NO__ERROR && (fields =
mapi_fetch_row(hdl)) != 0) {
int valuew = 0, len;
++rec;
for (i = 0; i < fields; i++) {
@@ -836,7 +811,7 @@ CSVrenderer(MapiHdl hdl)
}
mnstr_printf(toConsole, "\n");
}
- while (mnstr_errnr(toConsole) == MNSTR_NO__ERROR && (fields =
fetch_row(hdl)) != 0) {
+ while (mnstr_errnr(toConsole) == MNSTR_NO__ERROR && (fields =
mapi_fetch_row(hdl)) != 0) {
for (i = 0; i < fields; i++) {
s = mapi_fetch_field(hdl, i);
if (!noquote && s != NULL && s[strcspn(s, specials)] !=
'\0') {
@@ -1070,7 +1045,7 @@ TESTrenderer(MapiHdl hdl)
char *sep;
int i;
- while (mnstr_errnr(toConsole) == MNSTR_NO__ERROR && (reply =
fetch_line(hdl)) != 0) {
+ while (mnstr_errnr(toConsole) == MNSTR_NO__ERROR && (reply =
mapi_fetch_line(hdl)) != 0) {
if (*reply != '[') {
if (*reply == '=')
reply++;
@@ -1221,7 +1196,7 @@ RAWrenderer(MapiHdl hdl)
{
char *line;
- while ((line = fetch_line(hdl)) != 0) {
+ while ((line = mapi_fetch_line(hdl)) != 0) {
if (*line == '=')
line++;
mnstr_printf(toConsole, "%s\n", line);
@@ -1264,12 +1239,12 @@ SQLdebugRendering(MapiHdl hdl)
int cnt = 0;
snprintf(promptbuf, sizeof(promptbuf), "mdb>");
- while ((reply = fetch_line(hdl))) {
+ while ((reply = mapi_fetch_line(hdl))) {
cnt++;
mnstr_printf(toConsole, "%s\n", reply);
if (strncmp(reply, "mdb>#EOD", 8) == 0) {
cnt = 0;
- while ((reply = fetch_line(hdl)))
+ while ((reply = mapi_fetch_line(hdl)))
mnstr_printf(toConsole, "%s\n", reply);
break;
}
@@ -1515,7 +1490,7 @@ SQLrenderer(MapiHdl hdl)
lines = SQLheader(hdl, len, printfields, fields != printfields);
int64_t nrows = 0; /* count number of rows printed
*/
- while ((rfields = fetch_row(hdl)) != 0) {
+ while ((rfields = mapi_fetch_row(hdl)) != 0) {
if (mnstr_errnr(toConsole) != MNSTR_NO__ERROR)
continue;
if (rfields != fields) {
@@ -1858,9 +1833,9 @@ format_result(Mapi mid, MapiHdl hdl, boo
mnstr_printf(stderr_stream,
"invalid/unknown response from
server, "
"ignoring output\n");
- for (i = 0; i < 5 && (reply = fetch_line(hdl))
!= 0; i++)
+ for (i = 0; i < 5 && (reply =
mapi_fetch_line(hdl)) != 0; i++)
mnstr_printf(stderr_stream, "? %s\n",
reply);
- if (i == 5 && fetch_line(hdl) != 0) {
+ if (i == 5 && mapi_fetch_line(hdl) != 0) {
mnstr_printf(stderr_stream,
"(remaining output
omitted, "
"use \\fraw to examine in
detail)\n");
@@ -1872,7 +1847,7 @@ format_result(Mapi mid, MapiHdl hdl, boo
* logic there doesn't expect
* random unread garbage
* somehow */
- while (fetch_line(hdl) != 0)
+ while (mapi_fetch_line(hdl) != 0)
;
}
continue;
@@ -2579,7 +2554,7 @@ doFile(Mapi mid, stream *fp, bool useins
size_t tquerylen = 0;
hdl = mapi_query(mid, "select
value from sys.env() where name = 'monet_version'");
CHECK_RESULT(mid, hdl, buf, fp);
- if (fetch_row(hdl) > 0) {
+ if (mapi_fetch_row(hdl) > 0) {
const char *version =
mapi_fetch_field(hdl, 0);
int major, minor, patch;
if (version &&
@@ -2626,7 +2601,7 @@ doFile(Mapi mid, stream *fp, bool useins
free(query);
CHECK_RESULT(mid, hdl, buf, fp);
char *prevs1name = NULL,
*prevt1name = NULL;
- while (fetch_row(hdl) > 0) {
+ while (mapi_fetch_row(hdl) > 0)
{
const char *s1name =
mapi_fetch_field(hdl, 0);
const char *t1name =
mapi_fetch_field(hdl, 1);
const char *c1name =
mapi_fetch_field(hdl, 2);
@@ -2829,7 +2804,7 @@ doFile(Mapi mid, stream *fp, bool useins
hdl = mapi_query(mid, query);
free(query);
CHECK_RESULT(mid, hdl, buf, fp);
- while (fetch_row(hdl) == 3) {
+ while (mapi_fetch_row(hdl) ==
3) {
const char *type =
mapi_fetch_field(hdl, 0);
const char *name =
mapi_fetch_field(hdl, 1);
const char *remark =
mapi_fetch_field(hdl, 2);
@@ -3049,9 +3024,13 @@ doFile(Mapi mid, stream *fp, bool useins
break;
}
} else {
+ bool istrash = formatter ==
TRASHformatter;
setFormatter(line);
if (mode == SQL)
mapi_set_size_header(mid, strcmp(line, "raw") == 0);
+ if (istrash != (formatter ==
TRASHformatter)) {
+ mapi_cache_limit(mid,
formatter == TRASHformatter ? 100 : CACHELIMIT);
+ }
}
continue;
case 't':
@@ -3924,7 +3903,6 @@ main(int argc, char **argv)
exit(2);
}
- mapi_cache_limit(mid, 1000);
mapi_setAutocommit(mid, autocommit);
if (mode == SQL && !settz)
mapi_set_time_zone(mid, 0);
@@ -3932,6 +3910,7 @@ main(int argc, char **argv)
setFormatter(output);
if (mode == SQL)
mapi_set_size_header(mid, strcmp(output, "raw") == 0);
+ mapi_cache_limit(mid, formatter == TRASHformatter ? 100 :
CACHELIMIT);
} else {
if (mode == SQL) {
setFormatter("sql");
@@ -3939,6 +3918,7 @@ main(int argc, char **argv)
} else {
setFormatter("raw");
}
+ mapi_cache_limit(mid, CACHELIMIT);
}
if (logfile)
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]