Changeset: 6d8217537f14 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6d8217537f14
Modified Files:
        monetdb5/mal/mal_listing.c
        monetdb5/mal/mal_listing.h
        monetdb5/mal/mal_parser.c
        monetdb5/modules/mal/remote.c
Branch: default
Log Message:

Upgrade the rendering for remote executions


diffs (129 lines):

diff --git a/monetdb5/mal/mal_listing.c b/monetdb5/mal/mal_listing.c
--- a/monetdb5/mal/mal_listing.c
+++ b/monetdb5/mal/mal_listing.c
@@ -79,7 +79,8 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk, 
                        strcat(buf+len,cv);
                        len += strlen(buf+len);
                        if( cv) GDKfree(cv);
-                       showtype =getColumnType(getVarType(mb,varid)) > 
TYPE_str || ((isVarUDFtype(mb,varid) || isVarTypedef(mb,varid)) && 
isVarConstant(mb,varid)) || isaBatType(getVarType(mb,varid));
+                       showtype =getColumnType(getVarType(mb,varid)) > 
TYPE_str || 
+                               ((isVarUDFtype(mb,varid) || 
isVarTypedef(mb,varid)) && isVarConstant(mb,varid)) || 
isaBatType(getVarType(mb,varid)); 
                } else{
                        if ( !isaBatType(getVarType(mb,varid)) && 
getColumnType(getVarType(mb,varid)) > TYPE_str ){
                                closequote = 1;
@@ -94,8 +95,8 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk, 
                                strcat(buf+len,"\"");
                                len++;
                        }
-                       showtype =getColumnType(getVarType(mb,varid)) > 
TYPE_str || ((isVarUDFtype(mb,varid) || 
-                                       isVarTypedef(mb,varid)) && 
isVarConstant(mb,varid)) || isaBatType(getVarType(mb,varid));
+                       showtype =closequote > TYPE_str || 
((isVarUDFtype(mb,varid) || isVarTypedef(mb,varid)) && isVarConstant(mb,varid)) 
|| 
+                               (isaBatType(getVarType(mb,varid) && idx < 
p->retc));
 
                        if (stk && isaBatType(getVarType(mb,varid)) && 
abs(stk->stk[varid].val.ival) ){
                                BAT *d= 
BBPquickdesc(abs(stk->stk[varid].val.ival),TRUE);
@@ -380,7 +381,7 @@ instruction2str(MalBlkPtr mb, MalStkPtr 
 }
 
 str
-mal2str(MalBlkPtr mb, int flg, int first, int last)
+mal2str(MalBlkPtr mb, int first, int last)
 {
        str ps, *txt;
        int i, *len, totlen = 0;
@@ -395,7 +396,10 @@ mal2str(MalBlkPtr mb, int flg, int first
                return NULL;
        }
        for (i = first; i < last; i++) {
-               txt[i] = instruction2str(mb, 0, getInstrPtr(mb, i), flg);
+               if( i == 0)
+                       txt[i] = instruction2str(mb, 0, getInstrPtr(mb, i), 
LIST_MAL_NAME | LIST_MAL_TYPE  | LIST_MAL_PROPS);
+               else
+                       txt[i] = instruction2str(mb, 0, getInstrPtr(mb, i), 
LIST_MAL_CALL );
                if ( txt[i])
                        totlen += len[i] = (int)strlen(txt[i]);
        }
@@ -421,8 +425,8 @@ mal2str(MalBlkPtr mb, int flg, int first
 }
 
 str
-function2str(MalBlkPtr mb, int flg){
-       return mal2str(mb,flg,0,mb->stop);
+function2str(MalBlkPtr mb){
+       return mal2str(mb, 0,mb->stop);
 }
 
 void
diff --git a/monetdb5/mal/mal_listing.h b/monetdb5/mal/mal_listing.h
--- a/monetdb5/mal/mal_listing.h
+++ b/monetdb5/mal/mal_listing.h
@@ -21,8 +21,8 @@ mal_export void printInstruction(stream 
 mal_export str instructionCall(MalBlkPtr mb, InstrPtr p, str s, str base, 
size_t len);
 mal_export void promptInstruction(stream *fd, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr p, int flg);
 mal_export str instruction2str(MalBlkPtr mb, MalStkPtr stl, InstrPtr p, int 
hidden);
-mal_export str mal2str(MalBlkPtr mb, int flg, int first, int last);
-mal_export str function2str(MalBlkPtr mb, int flg);
+mal_export str mal2str(MalBlkPtr mb, int first, int last);
+mal_export str function2str(MalBlkPtr mb);
 mal_export void showMalBlkHistory(stream *out, MalBlkPtr mb);
 
 #endif /*  _MAL_LIST_H */
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
@@ -446,6 +446,11 @@ cstToken(Client cntxt, ValPtr cst)
                                GDKfree(pval);
                        } else
                                cst->val.dval = 0;
+
+                       if (cst->val.dval > FLT_MIN && cst->val.dval <= 
FLT_MAX) {
+                               cst->vtype = TYPE_flt;
+                               cst->val.fval = (flt) cst->val.dval;
+                       }
                }
                if (*s == '@') {
                        int len = (int) sizeof(lng);
@@ -913,13 +918,9 @@ term(Client cntxt, MalBlkPtr curBlk, Ins
        malType tpe = TYPE_any;
 
        if ((i = cstToken(cntxt, &cst))) {
-               advance(cntxt, i);
-               if (currChar(cntxt) != ':' && cst.vtype == TYPE_dbl && 
cst.val.dval > FLT_MIN && cst.val.dval <= FLT_MAX) {
-                       cst.vtype = TYPE_flt;
-                       cst.val.fval = (flt) cst.val.dval;
-               }
                cstidx = fndConstant(curBlk, &cst, MAL_VAR_WINDOW);
                if (cstidx >= 0) {
+                       advance(cntxt, i);
                        if (currChar(cntxt) == ':') {
                                tpe = typeElm(cntxt, getVarType(curBlk, 
cstidx));
                                if (tpe < 0)
@@ -944,6 +945,7 @@ term(Client cntxt, MalBlkPtr curBlk, Ins
                        return ret;
                } else {
                        /* add a new constant */
+                       advance(cntxt, i);
                        flag = currChar(cntxt) == ':';
                        tpe = typeElm(cntxt, cst.vtype);
                        if (tpe < 0)
@@ -1210,7 +1212,7 @@ fcnHeader(Client cntxt, int kind)
                        cntxt->curprg = cntxt->backup;
                        cntxt->backup = 0;
                }
-               parseError(cntxt, "<module> not defined\n");
+               parseError(cntxt, "<module> name not defined\n");
                return curBlk;
        }
 
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
@@ -839,7 +839,7 @@ str RMTregisterInternal(Client cntxt, st
                                mod, fcn);
        }
 
-       qry = function2str(sym->def,  LIST_MAL_CALL );
+       qry = function2str(sym->def);
 #ifdef _DEBUG_REMOTE
        mnstr_printf(cntxt->fdout, "#remote.register:%s:%s\n", c->name, qry);
 #endif
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to