Changeset: 5353030fa1df for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5353030fa1df
Modified Files:
        sql/storage/bat/bat_logger.c
Branch: Aug2024
Log Message:

Fix for bug #7597: record updated size of system tables after insert.


diffs (34 lines):

diff --git a/sql/storage/bat/bat_logger.c b/sql/storage/bat/bat_logger.c
--- a/sql/storage/bat/bat_logger.c
+++ b/sql/storage/bat/bat_logger.c
@@ -115,6 +115,7 @@ tabins(logger *lg, ...)
        BAT *b;
 
        va_start(va, lg);
+       BATiter cni = bat_iterator(lg->catalog_id);
        while ((cid = va_arg(va, int)) != 0) {
                cval = va_arg(va, void *);
                if ((b = log_temp_descriptor(log_find_bat(lg, cid))) == NULL) {
@@ -122,10 +123,22 @@ tabins(logger *lg, ...)
                        break;
                }
                rc = BUNappend(b, cval, true);
+               if (rc == GDK_SUCCEED) {
+                       BUN p;
+                       MT_rwlock_rdlock(&cni.b->thashlock);
+                       HASHloop_int(cni, cni.b->thash, p, &cid) {
+                               if (BUNfnd(lg->dcatalog, &(oid){p}) == 
BUN_NONE) {
+                                       rc = BUNreplace(lg->catalog_cnt, p, 
&(lng){BATcount(b)}, false);
+                                       break;
+                               }
+                       }
+                       MT_rwlock_rdunlock(&cni.b->thashlock);
+               }
                bat_destroy(b);
                if (rc != GDK_SUCCEED)
                        break;
        }
+       bat_iterator_end(&cni);
        va_end(va);
        return rc;
 }
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to