Changeset: 50b39a9653ca for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/50b39a9653ca
Modified Files:
        monetdb5/modules/mal/pcre.c
Branch: qcancel
Log Message:

timeout pcre likeselect and pcre join


diffs (73 lines):

diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c
--- a/monetdb5/modules/mal/pcre.c
+++ b/monetdb5/modules/mal/pcre.c
@@ -1835,6 +1835,8 @@ BATPCREnotilike2(Client cntxt, MalBlkPtr
                                  "scanselect %s\n", BATgetId(b), BATcount(b),  
                \
                                  s ? BATgetId(s) : "NULL", anti, #TEST);       
                        \
                for (p = 0; p < ci.ncand; p++) {                                
                                \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter,                  
                        \
+                                       GOTO_LABEL_TIMEOUT_HANDLER(bailout));   
                        \
                        o = canditer_next(&ci);                                 
                                        \
                        r = (BUN) (o - off);                                    
                                        \
                        v = BUNtvar(bi, r);                                     
                                                \
@@ -1854,6 +1856,8 @@ BATPCREnotilike2(Client cntxt, MalBlkPtr
                                  "scanselect %s\n", BATgetId(b), BATcount(b),  
                \
                                  s ? BATgetId(s) : "NULL", anti, #TEST);       
                        \
                while (p < q) {                                                 
                                                \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter,                  
                        \
+                                       GOTO_LABEL_TIMEOUT_HANDLER(bailout));   
                        \
                        v = BUNtvar(bi, p-off);                                 
                                        \
                        if (TEST) {                                             
                                                        \
                                o = (oid) p;                                    
                                                \
@@ -1890,6 +1894,13 @@ pcre_likeselect(BAT **bnp, BAT *b, BAT *
        str msg = MAL_SUCCEED;
        struct canditer ci;
 
+       size_t counter = 0;
+       lng timeoffset = 0;
+       QryCtx *qry_ctx = MT_thread_get_qry_ctx();
+       if (qry_ctx != NULL) {
+               timeoffset = (qry_ctx->starttime && qry_ctx->querytimeout) ? 
(qry_ctx->starttime + qry_ctx->querytimeout) : 0;
+       }
+
        canditer_init(&ci, b, s);
 
        if (!(bn = COLnew(0, TYPE_oid, ci.ncand, TRANSIENT))) {
@@ -1950,6 +1961,14 @@ re_likeselect(BAT **bnp, BAT *b, BAT *s,
        str msg = MAL_SUCCEED;
        struct canditer ci;
 
+       size_t counter = 0;
+       lng timeoffset = 0;
+       QryCtx *qry_ctx = MT_thread_get_qry_ctx();
+       if (qry_ctx != NULL) {
+               timeoffset = (qry_ctx->starttime && qry_ctx->querytimeout) ? 
(qry_ctx->starttime + qry_ctx->querytimeout) : 0;
+       }
+
+
        canditer_init(&ci, b, s);
 
        if (!(bn = COLnew(0, TYPE_oid, ci.ncand, TRANSIENT))) {
@@ -2135,6 +2154,8 @@ PCRElikeselect5(bat *ret, const bat *bid
 #define pcre_join_loop(STRCMP, RE_MATCH, PCRE_COND) \
        do { \
                for (BUN ri = 0; ri < rci.ncand; ri++) { \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter, \
+                                       GOTO_LABEL_TIMEOUT_HANDLER(bailout)); \
                        ro = canditer_next(&rci); \
                        vr = VALUE(r, ro - r->hseqbase); \
                        nl = 0; \
@@ -2244,6 +2265,13 @@ pcrejoin(BAT *r1, BAT *r2, BAT *l, BAT *
        void *pcreex = NULL;
 #endif
 
+       size_t counter = 0;
+       lng timeoffset = 0;
+       QryCtx *qry_ctx = MT_thread_get_qry_ctx();
+       if (qry_ctx != NULL) {
+               timeoffset = (qry_ctx->starttime && qry_ctx->querytimeout) ? 
(qry_ctx->starttime + qry_ctx->querytimeout) : 0;
+       }
+
        TRC_DEBUG(ALGO,
                          "pcrejoin(l=%s#" BUNFMT "[%s]%s%s,"
                          "r=%s#" BUNFMT "[%s]%s%s,sl=%s#" BUNFMT "%s%s,"
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to