Changeset: 5942b7e5f6bc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5942b7e5f6bc
Modified Files:
        sql/storage/store.c
Branch: Dec2025
Log Message:

Dynamically figure out highest "instore" id.


diffs (26 lines):

diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -78,10 +78,11 @@ store_oldest_pending(sqlstore *store)
        return store->oldest_pending;
 }
 
+static sqlid highest_id; /* highest id doled out by bootstrap_create_column */
 static inline bool
 instore(sqlid id)
 {
-       if (id >= 2000 && id <= 2171)
+       if (id >= 2000 && id <= highest_id)
                return true;
        return false;
 }
@@ -1628,6 +1629,9 @@ bootstrap_create_column(sql_trans *tr, s
        sqlstore *store = tr->store;
        sql_column *col = ZNEW(sql_column);
 
+       if (id > highest_id)
+               highest_id = id;
+
        if ((sqlid) ATOMIC_GET(&store->obj_id) <= id)
                ATOMIC_SET(&store->obj_id, id + 1);
        TRC_DEBUG(SQL_STORE, "Create column: %s\n", name);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to