Changeset: 23951c4d7c2b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=23951c4d7c2b
Modified Files:
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql_gencode.c
        sql/backends/monet5/sql_result.c
        sql/backends/monet5/sql_statement.c
Branch: nospare
Log Message:

merged with default


diffs (truncated from 1711 to 300 lines):

diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c
--- a/clients/mapiclient/mhelp.c
+++ b/clients/mapiclient/mhelp.c
@@ -54,7 +54,7 @@ SQLhelp sqlhelp1[] = {
         "",
         "ALTER SCHEMA [ IF EXISTS ] ident RENAME TO ident",
         "ident",
-        "See also 
https://www.monetdb.org/Documentation/SQLreference/TableDefinitions/AlterStatement"},
+        "See also 
https://www.monetdb.org/Documentation/SQLReference/DataDefinition/SchemaDefinitions"},
        {"ALTER SEQUENCE",
         "",
         "ALTER SEQUENCE qname [ AS seq_int_datatype] [ RESTART [WITH intval]] 
[INCREMENT BY intval]\n"
@@ -191,7 +191,7 @@ SQLhelp sqlhelp1[] = {
         "",
         "CREATE REPLICA TABLE [ IF NOT EXISTS ] qname table_source",
         NULL,
-        "See also 
https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/TransactionReplication"},
+        "See also 
https://www.monetdb.org/Documentation/SQLReference/TableDefinitions"},
        {"CREATE ROLE",
         "Create a new role. You can grant privileges to a role and next\n"
         "grant a role (or multiple roles) to specific users",
@@ -246,7 +246,7 @@ SQLhelp sqlhelp1[] = {
         "    RETURNS function_return_data_type\n"
         "    EXTERNAL NAME ident ',' ident",
         "qname,param,function_return_data_type,ident",
-        "See also 
https://www.monetdb.org/Documentation/SQLreference/ProgrammingSQL/Functions"},
+        "See also 
https://www.monetdb.org/Documentation/SQLReference/DataManipulation/WindowFunctions"},
        {"CURRENT_DATE",
         "Pseudo column or function to get the current date",
         "CURRENT_DATE [ '(' ')' ]",
@@ -291,7 +291,7 @@ SQLhelp sqlhelp1[] = {
         "Debug a SQL statement using MAL debugger",
         "DEBUG statement",
         NULL,
-        
"https://www.monetdb.org/Documentation/SQLreference/RuntimeFeatures/Debug"},
+        "See also 
https://www.monetdb.org/Documentation/SQLreference/RuntimeFeatures/Debug"},
        {"DECLARE",
         "Define a local variable",
         "DECLARE ident_list data_type",
diff --git a/common/stream/stream.h b/common/stream/stream.h
--- a/common/stream/stream.h
+++ b/common/stream/stream.h
@@ -232,7 +232,6 @@ stream_export stream *bs_stream(stream *
 typedef enum {
        PROTOCOL_AUTO = 0, // unused
        PROTOCOL_9 = 1, // mal_mapi.c, mal_client.c;
-       PROTOCOL_10 = 2, // mal_mapi.c, sql_result.c
        PROTOCOL_COLUMNAR = 3 // sql_result.c
 } protocol_version;
 
diff --git a/common/utils/mcrypt.c b/common/utils/mcrypt.c
--- a/common/utils/mcrypt.c
+++ b/common/utils/mcrypt.c
@@ -45,7 +45,6 @@ mcrypt_getHashAlgorithms(void)
         * desire.
         */
        static const char *algorithms =
-               "PROT10"
 #ifdef HAVE_RIPEMD160_UPDATE
                ",RIPEMD160"
 #endif
diff --git 
a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out 
b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out
--- a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out
+++ b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out
@@ -17,7 +17,7 @@
 % clob # type
 % 235 # length
 function user.main():void;
-    X_1:void := querylog.define("explain copy into ttt from 
\\'/tmp/xyz\\';":str, "sequential_pipe":str, 22:int);
+    querylog.define("explain copy into ttt from \\'/tmp/xyz\\';":str, 
"sequential_pipe":str, 22:int);
     X_4:int := sql.mvc();
     (X_28:bat[:int], X_29:bat[:int], X_30:bat[:int]) := 
sql.copy_from(0x7fc1401da5c0:ptr, "|":str, "\n":str, nil:str, "null":str, 
"/tmp/xyz":str, -1:lng, 0:lng, 0:int, 0:int, nil:str, 0:int, 1:int);
     X_32:int := sql.append(X_4:int, "sys":str, "ttt":str, 
"averylongcolumnnametomakeitlargeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee":str,
 X_28:bat[:int]);
@@ -77,7 +77,7 @@ end user.main;
 % clob # type
 % 235 # length
 function user.main():void;
-    X_1:void := querylog.define("explain copy into ttt from 
\\'/tmp/xyz\\';":str, "user_0":str, 22:int);
+    querylog.define("explain copy into ttt from \\'/tmp/xyz\\';":str, 
"user_0":str, 22:int);
     X_4:int := sql.mvc();
     (X_28:bat[:int], X_29:bat[:int], X_30:bat[:int]) := 
sql.copy_from(0x7fc1401da5c0:ptr, "|":str, "\n":str, nil:str, "null":str, 
"/tmp/xyz":str, -1:lng, 0:lng, 0:int, 0:int, nil:str, 0:int, 1:int);
     X_32:int := sql.append(X_4:int, "sys":str, "ttt":str, 
"averylongcolumnnametomakeitlargeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee":str,
 X_28:bat[:int]);
diff --git 
a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
 
b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
--- 
a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
+++ 
b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows
@@ -18,7 +18,7 @@
 % clob # type
 % 235 # length
 function user.main():void;
-    X_1:void := querylog.define("explain copy into ttt from 
E\\'\\\\\\\\tmp/xyz\\';":str, "sequential_pipe":str, 22:int);
+    querylog.define("explain copy into ttt from E\\'\\\\\\\\tmp/xyz\\';":str, 
"sequential_pipe":str, 22:int);
     X_4:int := sql.mvc();
     (X_28:bat[:int], X_29:bat[:int], X_30:bat[:int]) := 
sql.copy_from(0x00000049B72361C0:ptr, "|":str, "\n":str, nil:str, "null":str, 
"\\tmp/xyz":str, -1:lng, 0:lng, 0:int, 0:int, nil:str, 0:int, 1:int);
     X_32:int := sql.append(X_4:int, "sys":str, "ttt":str, 
"averylongcolumnnametomakeitlargeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee":str,
 X_28:bat[:int]);
@@ -59,7 +59,7 @@ end user.main;
 % clob # type
 % 235 # length
 function user.main():void;
-    X_1:void := querylog.define("explain copy into ttt from 
E\\'a:\\\\\\\\tmp/xyz\\';":str, "sequential_pipe":str, 22:int);
+    querylog.define("explain copy into ttt from 
E\\'a:\\\\\\\\tmp/xyz\\';":str, "sequential_pipe":str, 22:int);
     X_4:int := sql.mvc();
     (X_28:bat[:int], X_29:bat[:int], X_30:bat[:int]) := 
sql.copy_from(0x00000049B72361C0:ptr, "|":str, "\n":str, nil:str, "null":str, 
"a:\\tmp/xyz":str, -1:lng, 0:lng, 0:int, 0:int, nil:str, 0:int, 1:int);
     X_32:int := sql.append(X_4:int, "sys":str, "ttt":str, 
"averylongcolumnnametomakeitlargeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee":str,
 X_28:bat[:int]);
diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h
--- a/monetdb5/mal/mal.h
+++ b/monetdb5/mal/mal.h
@@ -122,7 +122,7 @@ typedef struct VARRECORD {
     bool constant:1,
             typevar:1,
             fixedtype:1,
-            udftype:1,
+            //FREE SPOT NOW:1,
             cleanup:1,
             initialized:1,
             used:1,
diff --git a/monetdb5/mal/mal_builder.c b/monetdb5/mal/mal_builder.c
--- a/monetdb5/mal/mal_builder.c
+++ b/monetdb5/mal/mal_builder.c
@@ -158,7 +158,6 @@ newCatchStmt(MalBlkPtr mb, str nme)
                        freeException(msg);
                }else{
                        getArg(q,0) = k;
-                       setVarUDFtype(mb,getArg(q,0));
                }
        } else getArg(q,0) = i;
        return q;
@@ -621,7 +620,6 @@ pushNil(MalBlkPtr mb, InstrPtr q, int tp
        }
        if( _t >= 0){
                q= pushArgument(mb, q, _t);
-               setVarUDFtype(mb,getArg(q,q->argc-1)); /* needed */
        }
        return q;
 }
@@ -651,7 +649,6 @@ pushNilType(MalBlkPtr mb, InstrPtr q, ch
                } else {
                        _t = defConstant(mb,idx,&cst);
                        if( _t >= 0){
-                               setVarUDFtype(mb,_t);
                                return pushArgument(mb, q, _t);
                        }
                }
@@ -678,7 +675,6 @@ pushType(MalBlkPtr mb, InstrPtr q, int t
        } else {
                _t = defConstant(mb,tpe,&cst);
                if( _t >= 0){
-                       setVarUDFtype(mb,_t);
                        return pushArgument(mb, q, _t);
                }
        }
diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c
--- a/monetdb5/mal/mal_instruction.c
+++ b/monetdb5/mal/mal_instruction.c
@@ -769,7 +769,6 @@ setVariableType(MalBlkPtr mb, const int 
        clrVarUsed(mb, n);
        clrVarInit(mb, n);
        clrVarDisabled(mb, n);
-       clrVarUDFtype(mb, n);
        clrVarConstant(mb, n);
        clrVarCleanup(mb, n);
 }
@@ -822,8 +821,6 @@ cloneVariable(MalBlkPtr tm, MalBlkPtr mb
                setVarInit(tm, res);
        if (isVarDisabled(mb, x))
                setVarDisabled(tm, res);
-       if (isVarUDFtype(mb, x))
-               setVarUDFtype(tm, res);
        if (isVarCleanup(mb, x))
                setVarCleanup(tm, res);
        getVarSTC(tm,x) = getVarSTC(mb,x);
@@ -863,7 +860,6 @@ clearVariable(MalBlkPtr mb, int varid)
        v->constant= 0;
        v->typevar= 0;
        v->fixedtype= 0;
-       v->udftype= 0;
        v->cleanup= 0;
        v->initialized= 0;
        v->used= 0;
diff --git a/monetdb5/mal/mal_instruction.h b/monetdb5/mal/mal_instruction.h
--- a/monetdb5/mal/mal_instruction.h
+++ b/monetdb5/mal/mal_instruction.h
@@ -77,10 +77,6 @@
 #define setVarTypedef(M,I)             ((M)->var[I].typevar = 1)
 #define isVarTypedef(M,I)              ((M)->var[I].typevar)
 
-#define clrVarUDFtype(M,I)             ((M)->var[I].udftype = 0)
-#define setVarUDFtype(M,I)             ((M)->var[I].udftype = 1)
-#define isVarUDFtype(M,I)              ((M)->var[I].udftype)
-
 #define clrVarConstant(M,I)            ((M)->var[I].constant = 0)
 #define setVarConstant(M,I)            ((M)->var[I].constant = 1)
 #define isVarConstant(M,I)             ((M)->var[I].constant)
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
@@ -117,7 +117,7 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk, 
                        len += strlen(buf+len);
                        GDKfree(cv);
                        showtype = showtype || 
(getBatType(getVarType(mb,varid)) >= TYPE_date && 
getBatType(getVarType(mb,varid)) != TYPE_str) ||
-                               ((isVarUDFtype(mb,varid) || 
isVarTypedef(mb,varid)) && isVarConstant(mb,varid)) || 
isaBatType(getVarType(mb,varid));
+                               ((isVarTypedef(mb,varid)) && 
isVarConstant(mb,varid)) || isaBatType(getVarType(mb,varid));
                } else{
                        if ( !isaBatType(getVarType(mb,varid)) && 
getBatType(getVarType(mb,varid)) >= TYPE_date && 
getBatType(getVarType(mb,varid)) != TYPE_str ){
                                closequote = 1;
@@ -138,7 +138,7 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk, 
                                strcat(buf+len,"\"");
                                len++;
                        }
-                       showtype = showtype || closequote > TYPE_str || 
((isVarUDFtype(mb,varid) || isVarTypedef(mb,varid) || (flg & (LIST_MAL_REMOTE | 
LIST_MAL_TYPE))) && isVarConstant(mb,varid)) ||
+                       showtype = showtype || closequote > TYPE_str || 
((isVarTypedef(mb,varid) || (flg & (LIST_MAL_REMOTE | LIST_MAL_TYPE))) && 
isVarConstant(mb,varid)) ||
                                (isaBatType(getVarType(mb,varid)) && idx < 
p->retc);
 
                        if (stk && isaBatType(getVarType(mb,varid)) && 
stk->stk[varid].val.bval ){
@@ -151,7 +151,7 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk, 
 
        // show the type when required or frozen by the user
        // special care should be taken with constants, they may have been 
casted
-       if ((flg & LIST_MAL_TYPE) || (isVarUDFtype(mb, varid) && idx < p->retc) 
|| isVarTypedef(mb,varid) || showtype){
+       if ((flg & LIST_MAL_TYPE) || (idx < p->retc) || isVarTypedef(mb,varid) 
|| showtype){
                strcat(buf + len,":");
                len++;
                tpe = getTypeName(getVarType(mb, varid));
@@ -352,7 +352,7 @@ instruction2str(MalBlkPtr mb, MalStkPtr 
        case ASSIGNsymbol :
                // is any variable explicit or used
                for (i = 0; i < p->retc; i++)
-                       if ( !isTmpVar(mb,getArg(p,i)) || isVarUsed(mb, 
getArg(p, i)) || isVarUDFtype(mb,getArg(p,i)))
+                       if ( !isTmpVar(mb,getArg(p,i)) || isVarUsed(mb, 
getArg(p, i)))
                                break;
 
                if (i == p->retc)
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
@@ -866,7 +866,7 @@ binding(Client cntxt, MalBlkPtr curBlk, 
 static int
 term(Client cntxt, MalBlkPtr curBlk, InstrPtr *curInstr, int ret)
 {
-       int i, idx, flag, free = 1;
+       int i, idx, free = 1;
        ValRecord cst;
        int cstidx = -1;
        malType tpe = TYPE_any;
@@ -885,14 +885,11 @@ term(Client cntxt, MalBlkPtr curBlk, Ins
                                tpe = typeElm(cntxt, getVarType(curBlk, 
cstidx));
                                if (tpe < 0)
                                        return 3;
-                               if(tpe == getVarType(curBlk,cstidx) ){
-                                       setVarUDFtype(curBlk, cstidx);
-                               } else {
+                               if(tpe != getVarType(curBlk,cstidx) ){
                                        cstidx = defConstant(curBlk, tpe, &cst);
                                        if (cstidx < 0)
                                                return 3;
                                        setPolymorphic(*curInstr, tpe, FALSE);
-                                       setVarUDFtype(curBlk, cstidx);
                                        free = 0;
                                }
                        } else if (cst.vtype != getVarType(curBlk, cstidx)) {
@@ -909,7 +906,6 @@ term(Client cntxt, MalBlkPtr curBlk, Ins
                        return ret;
                } else {
                        /* add a new constant literal, the :type could be 
erroneously be a coltype */
-                       flag = currChar(cntxt) == ':';
                        tpe = typeElm(cntxt, cst.vtype);
                        if (tpe < 0 )
                                return 3;
@@ -917,8 +913,6 @@ term(Client cntxt, MalBlkPtr curBlk, Ins
                        if (cstidx < 0)
                                return 3;
                        setPolymorphic(*curInstr, tpe, FALSE);
-                       if (flag)
-                               setVarUDFtype(curBlk, cstidx);
                        *curInstr = pushArgument(curBlk, *curInstr, cstidx);
                        return ret;
                }
@@ -1590,7 +1584,6 @@ parseAssign(Client cntxt, int cntrl)
                        }
                        GETvariable(freeInstruction(curInstr));
                        if (currChar(cntxt) == ':') {
-                               setVarUDFtype(curBlk, varid);
                                type = typeElm(cntxt, getVarType(curBlk, 
varid));
                                if (type < 0)
                                        goto part3;
@@ -1647,7 +1640,6 @@ parseAssign(Client cntxt, int cntrl)
                if (!(currChar(cntxt) == ':' && CURRENT(cntxt)[1] == '=')) {
                        curInstr->argv[0] = varid;
                        if (currChar(cntxt) == ':') {
-                               setVarUDFtype(curBlk, varid);
                                type = typeElm(cntxt, getVarType(curBlk, 
varid));
                                if (type < 0)
                                        goto part3;
diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -398,7 +398,6 @@ renderProfilerEvent(Client cntxt, MalBlk
                                return;
                        // if (!logadd(&logbuf, ",\"used\":%d", 
isVarUsed(mb,getArg(pci,j)))) return;
                        // if (!logadd(&logbuf, ",\"fixed\":%d", 
isVarFixed(mb,getArg(pci,j)))) return;
-                       // if (!logadd(&logbuf, ",\"udf\":%d", 
isVarUDFtype(mb,getArg(pci,j)))) return;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to