Changeset: 61c83f4f485c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/61c83f4f485c
Modified Files:
        gdk/gdk_batop.c
Branch: Jan2022
Log Message:

merged


diffs (43 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -572,6 +572,8 @@ vheapinit(BAT *b, const char *buf, bat b
                        TRC_CRITICAL(GDK, "cannot allocate memory for heap.");
                        return -1;
                }
+               if (b->batCount == 0)
+                       free = 0;
                if (b->ttype >= 0 &&
                    ATOMstorage(b->ttype) == TYPE_str &&
                    free < GDK_STRHASHTABLE * sizeof(stridx_t) + BATTINY * 
GDK_VARALIGN)
@@ -4408,7 +4410,8 @@ BBPdiskscan(const char *parent, size_t b
                                delete = true;
                        } else if (strncmp(p + 1, "tail", 4) == 0) {
                                BAT *b = getdesc(bid);
-                               delete = (b == NULL || !b->ttype || 
!b->batCopiedtodisk);
+                               delete = (b == NULL || !b->ttype || 
!b->batCopiedtodisk || b->batCount == 0);
+                               assert(b->batCount > 0 || b->theap->free == 0);
                                if (!delete) {
                                        if (b->ttype == TYPE_str) {
                                                switch (b->twidth) {
@@ -4433,7 +4436,7 @@ BBPdiskscan(const char *parent, size_t b
                                }
                        } else if (strncmp(p + 1, "theap", 5) == 0) {
                                BAT *b = getdesc(bid);
-                               delete = (b == NULL || !b->tvheap || 
!b->batCopiedtodisk);
+                               delete = (b == NULL || !b->tvheap || 
!b->batCopiedtodisk || b->tvheap->free == 0);
                        } else if (strncmp(p + 1, "thashl", 6) == 0 ||
                                   strncmp(p + 1, "thashb", 6) == 0) {
 #ifdef PERSISTENTHASH
diff --git a/sql/test/rename/Tests/rename00.SQL.py 
b/sql/test/rename/Tests/rename00.SQL.py
--- a/sql/test/rename/Tests/rename00.SQL.py
+++ b/sql/test/rename/Tests/rename00.SQL.py
@@ -21,7 +21,7 @@ with tempfile.TemporaryDirectory() as fa
             tc.execute('insert into "newname" values 
(1);').assertSucceeded().assertRowCount(1)
             tc.execute('select "a" from 
"newname";').assertSucceeded().assertDataResultMatch([(1,)])
         s.communicate()
-    with process.server(mapiport=s.dbport, dbname='db1',
+    with process.server(mapiport='0', dbname='db1',
                         dbfarm=os.path.join(farm_dir, 'db1'),
                         stdin=process.PIPE,
                         stdout=process.PIPE, stderr=process.PIPE) as s:
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to