Changeset: bc2572c4f72b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/bc2572c4f72b
Modified Files:
        gdk/ChangeLog.Sep2022
        gdk/gdk_bat.c
        sql/backends/monet5/UDF/pyapi3/pyheader.h
Branch: Sep2022
Log Message:

Merge with Jan2022 branch.


diffs (31 lines):

diff --git a/gdk/ChangeLog.Sep2022 b/gdk/ChangeLog.Sep2022
--- a/gdk/ChangeLog.Sep2022
+++ b/gdk/ChangeLog.Sep2022
@@ -1,3 +1,8 @@
 # ChangeLog file for GDK
 # This file is updated with Maddlog
 
+* Thu Dec  8 2022 Sjoerd Mullender <[email protected]>
+- When extending a bat failed, the capacity had been updated already and
+  was therefore too large.  This could then later cause a crash.  This has
+  been fixed by only updating the capacity if the extend succeeded.
+
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -547,10 +547,12 @@ BATextend(BAT *b, BUN newcap)
        if (b->theap->base) {
                TRC_DEBUG(HEAP, "HEAPgrow in BATextend %s %zu %zu\n",
                          b->theap->filename, b->theap->size, theap_size);
-               rc = HEAPgrow(&b->theap, theap_size, b->batRestricted == 
BAT_READ);
+               rc = HEAPgrow(&b->theaplock, &b->theap, theap_size, 
b->batRestricted == BAT_READ);
+               if (rc == GDK_SUCCEED)
+                       b->batCapacity = newcap;
+       } else {
+               b->batCapacity = newcap;
        }
-
-       b->batCapacity = newcap;
        MT_lock_unset(&b->theaplock);
 
        return rc;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to