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

Address test set-negative_timeout


diffs (40 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
@@ -560,13 +560,6 @@ str runMALsequence(Client cntxt, MalBlkP
                        lastcheck = runtimeProfile.ticks;
                }
 
-               // runtimeProfileBegin already sets the time in the instruction
-               if (cntxt->qtimeout && runtimeProfile.ticks - mb->starttime > 
cntxt->qtimeout) {
-                       freeException(ret);     /* in case it's set */
-                       ret = createException(MAL, "mal.interpreter", 
SQLSTATE(HYT00) RUNTIME_QRY_TIMEOUT);
-                       break;
-               }
-
                /* The interpreter loop
                 * The interpreter is geared towards execution a MAL
                 * procedure together with all its descendant
@@ -795,6 +788,13 @@ str runMALsequence(Client cntxt, MalBlkP
                        } else {
                                ret = createException(MAL,"interpreter", 
"failed instruction2str");
                        }
+                       // runtimeProfileBegin already sets the time in the 
instruction
+                       if (cntxt->qtimeout && mb->starttime && GDKusec()- 
mb->starttime > cntxt->qtimeout){
+                               freeException(ret);     /* in case it's set */
+                               ret = createException(MAL, "mal.interpreter", 
SQLSTATE(HYT00) RUNTIME_QRY_TIMEOUT);
+                               break;
+                       }
+
                        stkpc= mb->stop;
                        continue;
                }       }
@@ -911,6 +911,8 @@ str runMALsequence(Client cntxt, MalBlkP
 
                        /* unknown exceptions lead to propagation */
                        if (exceptionVar == -1) {
+                if (cntxt->qtimeout && mb->starttime && GDKusec()- 
mb->starttime > cntxt->qtimeout)
+                    ret= createException(MAL, "mal.interpreter", 
SQLSTATE(HYT00) RUNTIME_QRY_TIMEOUT);
                                stkpc = mb->stop;
                                continue;
                        }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to