Changeset: 166950293746 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=166950293746
Modified Files:
        monetdb5/mal/mal_interpreter.c
Branch: Jul2017
Log Message:

Garbage collect before returning


diffs (34 lines):

diff --git a/monetdb5/mal/mal_interpreter.c b/monetdb5/mal/mal_interpreter.c
--- a/monetdb5/mal/mal_interpreter.c
+++ b/monetdb5/mal/mal_interpreter.c
@@ -360,7 +360,7 @@ str runMAL(Client cntxt, MalBlkPtr mb, M
                garbageCollector(cntxt, mb, stk, env != stk);
        if (stk && stk != env)
                freeStack(stk);
-       if (cntxt->qtimeout && GDKusec()- mb->starttime > cntxt->qtimeout)
+       if (ret == MAL_SUCCEED && cntxt->qtimeout && GDKusec()- mb->starttime > 
cntxt->qtimeout)
                throw(MAL, "mal.interpreter", RUNTIME_QRY_TIMEOUT);
        return ret;
 }
@@ -452,10 +452,10 @@ callMAL(Client cntxt, MalBlkPtr mb, MalS
        default:
                throw(MAL, "mal.interpreter", RUNTIME_UNKNOWN_INSTRUCTION);
        }
+       if (stk) 
+               garbageCollector(cntxt, mb, stk, TRUE);
        if ( ret == MAL_SUCCEED && cntxt->qtimeout && GDKusec()- mb->starttime 
> cntxt->qtimeout)
                throw(MAL, "mal.interpreter", RUNTIME_QRY_TIMEOUT);
-       if (stk) 
-               garbageCollector(cntxt, mb, stk, TRUE);
        return ret;
 }
 
@@ -806,6 +806,8 @@ str runMALsequence(Client cntxt, MalBlkP
                        continue;
                runtimeProfileExit(cntxt, mb, stk, pci, &runtimeProfile);
                /* check for strong debugging after each MAL statement */
+               /* when we find a timeout situation, then the result is already 
known 
+                * and assigned,  the backup version is not removed*/
                if ( pci->token != FACcall && ret== MAL_SUCCEED) {
                        for (i = 0; i < pci->retc; i++) {
                                lhs = &backup[i];
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to