Changeset: 15751297c91a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=15751297c91a
Removed Files:
        monetdb5/mal/Tests/tst062.mal
Modified Files:
        clients/R/MonetDB.R/R/dbi.R
        clients/Tests/exports.stable.out
        monetdb5/mal/Tests/All
        monetdb5/mal/Tests/tst044.stable.out
        monetdb5/mal/Tests/tst804.stable.out
        monetdb5/mal/mal_listing.c
        monetdb5/mal/mal_listing.h
        monetdb5/mal/mal_parser.c
        monetdb5/modules/mal/remote.c
Branch: geo
Log Message:

Merge with default branch.


diffs (242 lines):

diff --git a/clients/R/MonetDB.R/R/dbi.R b/clients/R/MonetDB.R/R/dbi.R
--- a/clients/R/MonetDB.R/R/dbi.R
+++ b/clients/R/MonetDB.R/R/dbi.R
@@ -441,7 +441,7 @@ setClass("MonetDBResult", representation
 monetdbRtype <- function(dbType) {
   dbType <- toupper(dbType)
   
-  if (dbType %in% c("TINYINT", "SMALLINT", "INT", "BIGINT", "REAL", "DOUBLE", 
"DECIMAL", "WRD")) {                     
+  if (dbType %in% c("TINYINT", "SMALLINT", "INT", "BIGINT", "HUGEINT", "REAL", 
"DOUBLE", "DECIMAL", "WRD")) {                  
     return("numeric")
   }
   if (dbType %in% c("CHAR", "VARCHAR", "CLOB", "STR")) {
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -2277,6 +2277,7 @@ int hasSameSignature(MalBlkPtr mb, Instr
 int hasSideEffects(InstrPtr p, int strict);
 str hashRef;
 int headProp;
+str hgeRef;
 int hlbProp;
 int horiginProp;
 int hubProp;
diff --git a/monetdb5/mal/Tests/All b/monetdb5/mal/Tests/All
--- a/monetdb5/mal/Tests/All
+++ b/monetdb5/mal/Tests/All
@@ -56,7 +56,6 @@ tst058
 tst059
 tst060
 tst061
-tst062
 tst070
 tst071
 tst072
diff --git a/monetdb5/mal/Tests/tst044.stable.out 
b/monetdb5/mal/Tests/tst044.stable.out
--- a/monetdb5/mal/Tests/tst044.stable.out
+++ b/monetdb5/mal/Tests/tst044.stable.out
@@ -34,23 +34,23 @@ function user.main():void;
     io.print(a);
     a := 0.3415:flt;
     io.print(a);
-    b := 3.1449999809265137:dbl;
+    b := 3.145:dbl;
     io.print(b);
     b := -3.145:dbl;
     io.print(b);
-    b := 3.450000047683716:dbl;
+    b := 3.45:dbl;
     io.print(b);
-    b := 0.34150001406669617:dbl;
+    b := 0.3415:dbl;
     io.print(b);
 end user.main;
 [ 3.145 ]
 [ -3.145 ]
 [ 3.45 ]
 [ 0.3415 ]
-[ 3.1449999809265137 ]
+[ 3.145 ]
 [ -3.145 ]
-[ 3.450000047683716 ]
-[ 0.34150001406669617 ]
+[ 3.45 ]
+[ 0.3415 ]
 
 # 16:38:20 >  
 # 16:38:20 >  Done.
diff --git a/monetdb5/mal/Tests/tst062.mal b/monetdb5/mal/Tests/tst062.mal
deleted file mode 100644
--- a/monetdb5/mal/Tests/tst062.mal
+++ /dev/null
@@ -1,29 +0,0 @@
-#the number of return arguments does not match spect
-function user.l2() ;
-    X_3 := sql.mvc();
-    X_4:bat[:oid,:oid]  := sql.tid(X_3,"sys","part1");
-    X_7:bat[:oid,:dbl]  := sql.bind(X_3,"sys","part1","x",0);
-    X_10 := algebra.leftfetchjoin(X_4,X_7);
-    X_11:bat[:oid,:dbl]  := sql.bind(X_3,"sys","part1","y",0);
-    X_13 := algebra.leftfetchjoin(X_4,X_11);
-    X_14:bat[:oid,:dbl]  := sql.bind(X_3,"sys","part1","z",0);
-    X_16 := algebra.leftfetchjoin(X_4,X_14);
-    return (X_10,X_13,X_16) := (X_10,X_13,X_16);
-end l2;
-
-# the variabls X_10, X_13, X_16 are only valid within the parallel block
-function user.l1{sqlfunction}() 
(X_0:bat[:oid,:dbl]{sqlfunction},X_1:bat[:oid,:dbl],X_2:bat[:oid,:dbl]);
-barrier X_26 := language.dataflow();           
-    X_3 := sql.mvc();                          
-    X_4:bat[:oid,:oid] := sql.tid(X_3,"sys","part1");  
-    X_7:bat[:oid,:dbl] := sql.bind(X_3,"sys","part1","x",0);   
-    X_10 := algebra.leftfetchjoin(X_4,X_7);    
-    X_11:bat[:oid,:dbl] := sql.bind(X_3,"sys","part1","y",0);  
-    X_13 := algebra.leftfetchjoin(X_4,X_11);   
-    X_14:bat[:oid,:dbl] := sql.bind(X_3,"sys","part1","z",0);  
-    X_16 := algebra.leftfetchjoin(X_4,X_14);   
-    language.pass(X_4);                        
-exit X_26;                                     
-    return (X_10,X_13,X_16) := (X_10,X_13,X_16);       
-end user.l1;
-
diff --git a/monetdb5/mal/Tests/tst804.stable.out 
b/monetdb5/mal/Tests/tst804.stable.out
--- a/monetdb5/mal/Tests/tst804.stable.out
+++ b/monetdb5/mal/Tests/tst804.stable.out
@@ -13,7 +13,7 @@ stdout of test 'tst804` in directory 'mo
 ## test definiton of a function in a unknown module
 #function wrong.message():void;
 !SyntaxException:parseError:function wrong.message():void;
-!SyntaxException:parseError:                      ^<module> name not defined
+
 !SyntaxException:parseError:   io.print("shouldn't come here");
 !SyntaxException:parseError:^';' expected
 !SyntaxException:parseError:end message;
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