Changeset: 9b7490e6a80f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9b7490e6a80f
Modified Files:
        monetdb5/optimizer/opt_support.c
Branch: Dec2016
Log Message:

Update instructions have side effects.
Test sql/test/BugTracker-2016/select-in-from.Bug-6121 creates a plan
in which batcalc.min is calculated on two BATs, both of which are
appended to later on in the plan.  What you definitely don't want to
happen (and what this fixes) is that the append happens concurrently
with, or even before, the batcalc.min.


diffs (25 lines):

diff --git a/monetdb5/optimizer/opt_support.c b/monetdb5/optimizer/opt_support.c
--- a/monetdb5/optimizer/opt_support.c
+++ b/monetdb5/optimizer/opt_support.c
@@ -394,6 +394,10 @@ hasSideEffects(InstrPtr p, int strict)
 {
        if( getFunctionId(p) == NULL) return FALSE;
 
+       /* update instructions have side effects */
+       if (isUpdateInstruction(p))
+               return TRUE;
+
        if ( (getModuleId(p) == batRef || getModuleId(p)==sqlRef) &&
             (getFunctionId(p) == setAccessRef ||
                  getFunctionId(p) == setWriteModeRef ||
@@ -439,10 +443,6 @@ hasSideEffects(InstrPtr p, int strict)
                if (getFunctionId(p) == zero_or_oneRef) return FALSE;
                if (getFunctionId(p) == mvcRef) return FALSE;
                if (getFunctionId(p) == singleRef) return FALSE;
-               /* the update instructions for SQL has side effects.
-                  whether this is relevant should be explicitly checked
-                  in the environment of the call */
-               if (isUpdateInstruction(p)) return TRUE;
                return TRUE;
        }
        if( getModuleId(p) == languageRef){
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to