Changeset: af66c5eb4fd6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=af66c5eb4fd6
Modified Files:
        monetdb5/optimizer/opt_coercion.c
Branch: default
Log Message:

OPTcoercionImplementation(): remove non-scale-changing 2-argument dbl cast


diffs (19 lines):

diff --git a/monetdb5/optimizer/opt_coercion.c 
b/monetdb5/optimizer/opt_coercion.c
--- a/monetdb5/optimizer/opt_coercion.c
+++ b/monetdb5/optimizer/opt_coercion.c
@@ -135,7 +135,14 @@ OPTcoercionImplementation(Client cntxt,M
                        coerce[k].scale= 
getVarConstant(mb,getArg(p,4)).val.ival;
                }
 #endif
-               if ( getModuleId(p) == batcalcRef && getFunctionId(p) == dblRef 
&& p->retc == 1 && p->argc == 2 ){
+               if ( getModuleId(p) == batcalcRef
+                    && getFunctionId(p) == dblRef
+                    && p->retc == 1
+                    && ( p->argc == 2
+                         || ( p->argc == 3
+                              && isVarConstant(mb,getArg(p,1))
+                              && getArgType(mb,p,1) == TYPE_int
+                              && getVarValue(mb, getArg(p,1)) == 0 ) ) ) {
                        k = getArg(p,0);
                        coerce[k].pc= i;
                        coerce[k].totype= TYPE_dbl;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to