Changeset: f4a25338286e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f4a25338286e
Modified Files:
        gdk/gdk_calc.c
Branch: qcancel
Log Message:

timeout gdk_calc between any linear type


diffs (45 lines):

diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -14197,6 +14197,8 @@ VARcalcrsh(ValPtr ret, const ValRecord *
        do {                                                            \
                i = j = k = 0;                                          \
                for (l = 0; l < ncand; l++) {                           \
+                       GDK_CHECK_TIMEOUT(timeoffset, counter,          \
+                                       GOTO_LABEL_TIMEOUT_HANDLER(bailout)); \
                        if (incr1)                                      \
                                i = canditer_next(ci) - seqbase1;       \
                        if (incr2)                                      \
@@ -14230,6 +14232,13 @@ BATcalcbetween_intern(const void *src, b
        const void *nil;
        int (*atomcmp)(const void *, const void *);
 
+       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;
+       }
+
        bn = COLnew(ci->hseq, TYPE_bit, ncand, TRANSIENT);
        if (bn == NULL)
                return NULL;
@@ -14297,6 +14306,8 @@ BATcalcbetween_intern(const void *src, b
                nil = ATOMnilptr(tp);
                i = j = k = 0;
                for (l = 0; l < ncand; l++) {
+                       GDK_CHECK_TIMEOUT(timeoffset, counter,
+                                       GOTO_LABEL_TIMEOUT_HANDLER(bailout));
                        if (incr1)
                                i = canditer_next(ci) - seqbase1;
                        if (incr2)
@@ -14328,6 +14339,9 @@ BATcalcbetween_intern(const void *src, b
        bn->tnonil = nils == 0;
 
        return bn;
+bailout:
+       BBPunfix(bn->batCacheid);
+       return NULL;
 }
 
 BAT *
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to