Changeset: 03bd2346f5e2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/03bd2346f5e2
Modified Files:
        clients/Tests/MAL-signatures-hge.test
        gdk/gdk_bbp.c
        gdk/gdk_string.c
Branch: ustr
Log Message:

Merge with default branch.


diffs (truncated from 813 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
@@ -3384,11 +3384,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
@@ -30865,16 +30860,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
@@ -30884,11 +30869,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
@@ -45010,25 +44990,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)
 {
@@ -3018,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':
@@ -3893,11 +3903,6 @@ main(int argc, char **argv)
                exit(2);
        }
 
-#if SIZEOF_VOID_P == 4
-       mapi_cache_limit(mid, 1000);
-#else
-       mapi_cache_limit(mid, 5000);
-#endif
        mapi_setAutocommit(mid, autocommit);
        if (mode == SQL && !settz)
                mapi_set_time_zone(mid, 0);
@@ -3905,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");
@@ -3912,6 +3918,7 @@ main(int argc, char **argv)
                } else {
                        setFormatter("raw");
                }
+               mapi_cache_limit(mid, CACHELIMIT);
        }
 
        if (logfile)
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -433,8 +433,8 @@ vheapinit(BAT *b, const char *buf, unsig
                free = 0;
        if (b->ttype >= 0 &&
            ATOMstorage(b->ttype) == TYPE_str &&
-           free < GDK_STRHASHTABLE * sizeof(stridx_t) + BATTINY * GDK_VARALIGN)
-               size = GDK_STRHASHTABLE * sizeof(stridx_t) + BATTINY * 
GDK_VARALIGN;
+           free < GDK_STRHASHSIZE + BATTINY * GDK_VARALIGN)
+               size = GDK_STRHASHSIZE + BATTINY * GDK_VARALIGN;
        else if (free < 512)
                size = 512;
        else
diff --git a/gdk/gdk_string.c b/gdk/gdk_string.c
--- a/gdk/gdk_string.c
+++ b/gdk/gdk_string.c
@@ -70,7 +70,7 @@ strHeap(Heap *d, size_t cap)
        size_t size;
 
        cap = MAX(cap, BATTINY);
-       size = GDK_STRHASHTABLE * sizeof(stridx_t) + MIN(GDK_ELIMLIMIT, cap * 
GDK_VARALIGN);
+       size = GDK_STRHASHSIZE + MIN(GDK_ELIMLIMIT, cap * GDK_VARALIGN);
        return HEAPalloc(d, size, 1);
 }
 
@@ -86,8 +86,8 @@ strCleanHash(Heap *h, bool rebuild)
        (void) rebuild;
        if (!h->cleanhash)
                return;
-       if (h->size < GDK_STRHASHTABLE * sizeof(stridx_t) &&
-           HEAPextend(h, GDK_STRHASHTABLE * sizeof(stridx_t) + BATTINY * 
GDK_VARALIGN, true) != GDK_SUCCEED) {
+       if (h->size < GDK_STRHASHSIZE &&
+           HEAPextend(h, GDK_STRHASHSIZE + BATTINY * GDK_VARALIGN, true) != 
GDK_SUCCEED) {
                GDKclrerr();
                if (h->size > 0)
                        memset(h->base, 0, h->size);
@@ -359,13 +359,13 @@ strPut(BAT *b, var_t *dst, const void *V
        BUN off;
 
        if (h->free == 0) {
-               if (h->size < GDK_STRHASHTABLE * sizeof(stridx_t) + BATTINY * 
GDK_VARALIGN) {
-                       if (HEAPgrow(&b->tvheap, GDK_STRHASHTABLE * 
sizeof(stridx_t) + BATTINY * GDK_VARALIGN, true) != GDK_SUCCEED) {
+               if (h->size < GDK_STRHASHSIZE + BATTINY * GDK_VARALIGN) {
+                       if (HEAPgrow(&b->tvheap, GDK_STRHASHSIZE + BATTINY * 
GDK_VARALIGN, true) != GDK_SUCCEED) {
                                return (var_t) -1;
                        }
                        h = b->tvheap;
                }
-               h->free = GDK_STRHASHTABLE * sizeof(stridx_t);
+               h->free = GDK_STRHASHSIZE;
 #ifdef NDEBUG
                memset(h->base, 0, h->free);
 #else
diff --git a/monetdb5/mal/mal_client.h b/monetdb5/mal/mal_client.h
--- a/monetdb5/mal/mal_client.h
+++ b/monetdb5/mal/mal_client.h
@@ -86,11 +86,11 @@ typedef struct CLIENT {
        lng session;                            /* usec since start of server */
        time_t idle;                            /* Time when the session became 
idle */
        str peer;                                       /* Remote end of 
network connection */
-       str client_hostname;            /* Host name if reported by client, 
peer otherwise */
-       str client_application;         /* Application name reported by the 
client*/
-       str client_library;                     /* MAPI client library reported 
by the client */
+       const char *client_hostname; /* Host name if reported by client, peer 
otherwise */
+       const char *client_application; /* Application name reported by the 
client*/
+       const char *client_library;     /* MAPI client library reported by the 
client */
        long client_pid;                        /* client process id reported 
by the client */
-       str client_remark;                                      /* Other 
information reported by the client */
+       const char *client_remark; /* Other information reported by the client 
*/
 
        /*
         * For program debugging and performance trace we keep the actual 
resource claims.
diff --git a/monetdb5/mal/mal_parser.c b/monetdb5/mal/mal_parser.c
--- a/monetdb5/mal/mal_parser.c
+++ b/monetdb5/mal/mal_parser.c
@@ -1299,8 +1299,10 @@ argument(Client ctx, mel_func *curFunc, 
                if (type < 0)
                        return -1;
                int tt = getBatType(type);
-               if (tt != TYPE_any)
+               if (tt != TYPE_any) {
+                       assert(strlen(BATatoms[tt].name) < 14);
             strcpy(curArg->type, BATatoms[tt].name);
+               }
                if (isaBatType(type))
                        curArg->isbat = true;
                if (isPolymorphic(type)) {
@@ -1312,8 +1314,10 @@ argument(Client ctx, mel_func *curFunc, 
        } else if (currChar(ctx) == ':') {
                type = typeElm(ctx, TYPE_any);
                int tt = getBatType(type);
-               if (tt != TYPE_any)
+               if (tt != TYPE_any) {
+                       assert(strlen(BATatoms[tt].name) < 14);
             strcpy(curArg->type, BATatoms[tt].name);
+               }
                if (isaBatType(type))
                        curArg->isbat = true;
                if (isPolymorphic(type)) {
diff --git a/monetdb5/modules/atoms/inet-46.c b/monetdb5/modules/atoms/inet-46.c
--- a/monetdb5/modules/atoms/inet-46.c
+++ b/monetdb5/modules/atoms/inet-46.c
@@ -302,97 +302,6 @@ INETinet42inet4_bulk(Client ctx, bat *re
 }
 
 static str
-INETinet42str_bulk(Client ctx, bat *ret, const bat *bid, const bat *sid)
-{
-       allocator *ma = ctx->curprg->def->ma;
-       BAT *b = NULL, *s = NULL, *dst = NULL;
-       str msg = NULL;
-       inet4 *restrict vals;
-       struct canditer ci;
-       oid off;
-       bool nils = false, btkey = false;
-       char buf[16], *pbuf = buf;
-       size_t l = sizeof(buf);
-       ssize_t (*conv)(allocator *, char **, size_t *, const void *, bool) = 
BATatoms[TYPE_inet4].atomToStr;
-       BATiter bi;
-
-       if ((b = BATdescriptor(*bid)) == NULL) {
-               msg = createException(SQL, "batcalc.str",
-                                                         SQLSTATE(HY002) 
RUNTIME_OBJECT_MISSING);
-               goto bailout;
-       }
-       if (sid && !is_bat_nil(*sid) && (s = BATdescriptor(*sid)) == NULL) {
-               msg = createException(SQL, "batcalc.str",
-                                                         SQLSTATE(HY002) 
RUNTIME_OBJECT_MISSING);
-               goto bailout;
-       }
-       off = b->hseqbase;
-       canditer_init(&ci, b, s);
-       if (!(dst = COLnew(ci.hseq, TYPE_str, ci.ncand, TRANSIENT))) {
-               msg = createException(SQL, "batcalc.str",
-                                                         SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
-               goto bailout;
-       }
-
-       bi = bat_iterator(b);
-       vals = bi.base;
-       if (ci.tpe == cand_dense) {
-               for (BUN i = 0; i < ci.ncand; i++) {
-                       oid p = (canditer_next_dense(&ci) - off);
-                       inet4 v = vals[p];
-
-                       if (conv(ma, &pbuf, &l, &v, false) < 0) {       /* it 
should never be reallocated */
-                               msg = createException(MAL, "batcalc.str",
-                                                                         
GDK_EXCEPTION);
-                               goto bailout1;
-                       }
-                       if (tfastins_nocheckVAR(dst, i, buf) != GDK_SUCCEED) {
-                               msg = createException(SQL, "batcalc.str",
-                                                                         
SQLSTATE(HY013) MAL_MALLOC_FAIL);
-                               goto bailout1;
-                       }
-                       nils |= strNil(buf);
-               }
-       } else {
-               for (BUN i = 0; i < ci.ncand; i++) {
-                       oid p = (canditer_next(&ci) - off);
-                       inet4 v = vals[p];
-
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to