Changeset: 0231da036665 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0231da036665
Modified Files:
        monetdb5/modules/mal/remote.c
Branch: Oct2014
Log Message:

fix remote bat result code (ie set size of receiving bat properly)


diffs (60 lines):

diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c
--- a/monetdb5/modules/mal/remote.c
+++ b/monetdb5/modules/mal/remote.c
@@ -85,8 +85,8 @@ static unsigned char localtype = 0;
 static inline str RMTquery(MapiHdl *ret, str func, Mapi conn, str query);
 static inline str RMTinternalcopyfrom(BAT **ret, char *hdr, stream *in);
 
-#define newColumn(Var,Type,Tag)                                                
        \
-       Var = BATnew(TYPE_void, Type, 0, TRANSIENT);            \
+#define newColumn(Var,Type,sz,Tag)                                             
        \
+       Var = BATnew(TYPE_void, Type, sz, TRANSIENT);           \
        if ( Var == NULL) throw(MAL,Tag,MAL_MALLOC_FAIL);       \
        BATseqbase(Var,0);
 
@@ -115,7 +115,7 @@ str RMTresolve(bat *ret, str *pat) {
                throw(MAL, "remote.resolve", "this function needs the mserver "
                                "have been started by merovingian");
 
-       newColumn(list, TYPE_str, "remote.resolve");
+       newColumn(list, TYPE_str, 0, "remote.resolve");
 
        /* extract port from mero_uri, let mapi figure out the rest */
        mero_uri+=strlen("mapi:monetdb://");
@@ -534,7 +534,7 @@ str RMTget(Client cntxt, MalBlkPtr mb, M
                        return var;
                }
                t = getColumnType(rtype);
-               newColumn(b,t,"remote.get");
+               newColumn(b, t, 0, "remote.get");
 
                if (ATOMvarsized(t)) {
                        while (mapi_fetch_row(mhdl)) {
@@ -965,17 +965,14 @@ str RMTbatload(Client cntxt, MalBlkPtr m
        int s;
        BAT *b;
        size_t len;
-       //size_t pos;
        char *var;
-       //bit escaped = 0, instr = 0;
        bstream *fdin = cntxt->fdin;
 
        v = &stk->stk[pci->argv[0]]; /* return */
        t = getArgType(mb, pci, 1); /* tail type */
        size = *getArgReference_int(stk, pci, 2); /* size */
 
-       newColumn(b,t,"remote.load");
-       BATextend(b,size);
+       newColumn(b, t, size, "remote.load");
 
        /* grab the input stream and start reading */
        fdin->eof = 0;
@@ -1179,7 +1176,7 @@ RMTinternalcopyfrom(BAT **ret, char *hdr
                hdr++;
        }
 
-       newColumn(b, bb.Ttype,"remote.get");
+       newColumn(b, bb.Ttype, bb.size, "remote.get");
 
        /* for strings, the width may not match, fix it to match what we
         * retrieved */
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to