Changeset: 401c9bf21e6d for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/401c9bf21e6d Modified Files: sql/storage/bat/bat_logger.c Branch: check Log Message:
bat_logger upgrade code: add _columns.check column diffs (69 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 @@ -93,6 +93,14 @@ bl_preversion(sqlstore *store, int oldve } #endif +#ifdef CATALOG_FIRST_AFTER_DEC2023 + if (oldversion == CATALOG_FIRST_AFTER_DEC2023) { + /* upgrade to default releases */ + store->catalog_version = oldversion; + return GDK_SUCCEED; + } +#endif + return GDK_FAIL; } @@ -3240,6 +3248,50 @@ bl_postversion(void *Store, void *Lg) } #endif + +#ifdef CATALOG_FIRST_AFTER_DEC2023 + if (store->catalog_version <= CATALOG_FIRST_AFTER_DEC2023) { + /* new STRING column sys.keys.check */ + BAT *b = log_temp_descriptor(log_find_bat(lg, 2088)); /* sys.keys.id */ + if (b == NULL) + return GDK_FAIL; + BAT *check = BATconstant(b->hseqbase, TYPE_str, ATOMnilptr(TYPE_str), BATcount(b), PERSISTENT); + bat_destroy(b); + if (check == NULL) + return GDK_FAIL; + if ((check = BATsetaccess(check, BAT_READ)) == NULL || + /* 2165 is sys.keys.check */ + BUNappend(lg->catalog_id, &(int) {2165}, true) != GDK_SUCCEED || + BUNappend(lg->catalog_bid, &check->batCacheid, true) != GDK_SUCCEED || + BUNappend(lg->catalog_lid, &lng_nil, false) != GDK_SUCCEED || + BUNappend(lg->catalog_cnt, &(lng){BATcount(check)}, false) != GDK_SUCCEED + ) { + bat_destroy(check); + return GDK_FAIL; + } + BBPretain(check->batCacheid); + bat_destroy(check); + + if (tabins(lg, old_lg, tabins_first, -1, 0, + 2076, &(msk) {false}, /* sys._columns */ + /* 2165 is sys.keys.check */ + 2077, &(int) {2165}, /* sys._columns.id */ + 2078, "check", /* sys._columns.name */ + 2079, "varchar", /* sys._columns.type */ + 2080, &(int) {2048}, /* sys._columns.type_digits */ + 2081, &(int) {0}, /* sys._columns.type_scale */ + /* 2016 is sys.functions */ + 2082, &(int) {2016}, /* sys._columns.table_id */ + 2083, str_nil, /* sys._columns.default */ + 2084, &(bit) {TRUE}, /* sys._columns.null */ + 2085, &(int) {6}, /* sys._columns.number */ + 2086, str_nil, /* sys._columns.storage */ + 0) != GDK_SUCCEED) + return GDK_FAIL; + tabins_first = false; + } +#endif + return GDK_SUCCEED; } _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org