Changeset: 532c493dedae for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/532c493dedae
Modified Files:
        sql/storage/bat/bat_storage.c
Branch: Jul2021
Log Message:

small fix, ie collect info inside lock boundaries.


diffs (26 lines):

diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -544,6 +544,8 @@ count_deletes( segment *s, sql_trans *tr
 static size_t
 segs_end( segments *segs, sql_trans *tr, sql_table *table)
 {
+       size_t cnt = 0;
+
        lock_table(tr->store, table->base.id);
        segment *s = segs->h, *l = NULL;
 
@@ -551,10 +553,10 @@ segs_end( segments *segs, sql_trans *tr,
                if (SEG_IS_VALID(s, tr))
                                l = s;
        }
+       if (l)
+               cnt = l->end;
        unlock_table(tr->store, table->base.id);
-       if (!l)
-               return 0;
-       return l->end;
+       return cnt;
 }
 
 static size_t
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to