Changeset: 71ab4ee52655 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=71ab4ee52655 Modified Files: monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.stable.out.Windows monetdb5/mal/mal.h monetdb5/mal/mal_builder.c monetdb5/mal/mal_instruction.c monetdb5/mal/mal_instruction.h monetdb5/mal/mal_listing.c monetdb5/mal/mal_parser.c monetdb5/mal/mal_profiler.c monetdb5/modules/mal/Tests/call00.maltest monetdb5/modules/mal/manifold.c monetdb5/optimizer/opt_evaluate.c monetdb5/optimizer/opt_generator.c monetdb5/optimizer/opt_macro.c monetdb5/optimizer/opt_mitosis.c monetdb5/optimizer/opt_projectionpath.c monetdb5/optimizer/opt_remoteQueries.c sql/backends/monet5/sql_gencode.c sql/backends/monet5/sql_statement.c sql/server/rel_select.c Branch: default Log Message:
Remove udftype from VarRecord. diffs (truncated from 663 to 300 lines): 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; if (!logadd(&logbuf, "}")) return; } diff --git a/monetdb5/modules/mal/Tests/call00.maltest b/monetdb5/modules/mal/Tests/call00.maltest --- a/monetdb5/modules/mal/Tests/call00.maltest +++ b/monetdb5/modules/mal/Tests/call00.maltest @@ -27,7 +27,7 @@ m:=inspect.getSource("user","tst") query T rowsort io.print(m) ---- -"function user.tst(i:int, s:str):bit;\n j := calc.+(i, 1:int);\n io.print(j);\n format := \"hello %s\\n\";\n io.printf(format, s);\n return tst := true;\nend user.tst;\n" +"function user.tst(i:int, s:str):bit;\n j:int := calc.+(i, 1:int);\n io.print(j);\n format:str := \"hello %s\\n\";\n io.printf(format, s);\n return tst:bit := true;\nend user.tst;\n" statement ok language.call(m) diff --git a/monetdb5/modules/mal/manifold.c b/monetdb5/modules/mal/manifold.c --- a/monetdb5/modules/mal/manifold.c +++ b/monetdb5/modules/mal/manifold.c @@ -217,15 +217,12 @@ MANIFOLDtypecheck(Client cntxt, MalBlkPt setVarType(nmb,k,tpe); if ( isVarFixed(nmb,k)) setVarFixed(nmb,k); - if (isVarUDFtype(nmb,k)) - setVarUDFtype(nmb,k); // extract their scalar argument type for ( i = pci->retc+2; i < pci->argc; i++){ tpe = getBatType(getArgType(mb,pci,i)); q= pushArgument(nmb,q, k= newTmpVariable(nmb, tpe)); setVarFixed(nmb,k); - setVarUDFtype(nmb,k); } /* diff --git a/monetdb5/optimizer/opt_evaluate.c b/monetdb5/optimizer/opt_evaluate.c --- a/monetdb5/optimizer/opt_evaluate.c +++ b/monetdb5/optimizer/opt_evaluate.c @@ -203,7 +203,6 @@ OPTevaluateImplementation(Client cntxt, p->barrier = barrier; /* freeze the type */ setVarFixed(mb,getArg(p,1)); - setVarUDFtype(mb,getArg(p,1)); } else { /* if there is an error, we should postpone message handling, as the actual error (eg. division by zero ) may not happen) */ diff --git a/monetdb5/optimizer/opt_generator.c b/monetdb5/optimizer/opt_generator.c --- a/monetdb5/optimizer/opt_generator.c +++ b/monetdb5/optimizer/opt_generator.c @@ -52,7 +52,6 @@ pushInstruction(mb,P); }\ setModuleId(p,generatorRef);\ setFunctionId(p,parametersRef);\ - setVarUDFtype(mb,getArg(p,0));\ series[getArg(p,0)] = p;\ pushInstruction(mb,p); diff --git a/monetdb5/optimizer/opt_macro.c b/monetdb5/optimizer/opt_macro.c --- a/monetdb5/optimizer/opt_macro.c +++ b/monetdb5/optimizer/opt_macro.c @@ -130,16 +130,12 @@ inlineMALblock(MalBlkPtr mb, int pc, Mal for (n = 0; n < mc->vtop; n++) { _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list