Changeset: 6afcc29a229f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6afcc29a229f
Modified Files:
sql/storage/bat/bat_logger.c
Branch: Jul2021
Log Message:
Cosmetics.
diffs (55 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
@@ -1589,35 +1589,35 @@ upgrade(old_logger *lg)
goto bailout;
}
rc = GDK_FAIL;
- struct canditer ci;
- canditer_init(&ci, lg->catalog_bid, cands);
const int *bids;
- bids = (const int *) Tloc(lg->catalog_bid, 0);
- for (BUN i = 0; i < ci.ncand; i++) {
- BBPretain(bids[canditer_next(&ci) - lg->catalog_bid->hseqbase]);
- }
+ bids = (const int *) Tloc(lg->lg->catalog_bid,
lg->lg->catalog_bid->batCount - BATcount(cands));
+ for (BUN j = BATcount(cands), i = 0; i < j; i++)
+ BBPretain(bids[i]);
bat_destroy(cands);
bat_destroy(b);
/* convert deleted rows bats (catalog id equals table id) from list
* of deleted rows to mask of deleted rows */
BAT *tabs;
- /* 2165 is one larger than largest fixed id */
- tabs = BATselect(lg->lg->catalog_id, NULL, &(int){2165}, &int_nil,
true, true, false);
+ /* 2164 is the largest fixed id, so select anything larger */
+ tabs = BATselect(lg->lg->catalog_id, NULL, &(int){2164}, &int_nil,
false, true, false);
if (tabs == NULL)
goto bailout;
BAT *b1;
+ /* extract those rows that refer to a known table (in bats[1].idbat) */
b1 = BATintersect(lg->lg->catalog_id, bats[1].idbat, tabs,
bats[1].cands, false, false, BUN_NONE);
bat_destroy(tabs);
if (b1 == NULL)
goto bailout;
BAT *b3, *b4;
+ /* find a column (any column) in each of the tables */
if ((rc = BATsemijoin(&b3, &b4, lg->lg->catalog_id, bats[2].parbat, b1,
bats[2].cands, false, false, BUN_NONE)) != GDK_SUCCEED) {
bat_destroy(b1);
goto bailout;
}
rc = GDK_FAIL;
bat_destroy(b3);
+ /* extract column id */
b3 = BATproject(b4, bats[2].idbat);
bat_destroy(b4);
if (b3 == NULL) {
@@ -1630,6 +1630,7 @@ upgrade(old_logger *lg)
bat_destroy(b1);
goto bailout;
}
+ struct canditer ci;
canditer_init(&ci, lg->lg->catalog_bid, b1);
const oid *cbids;
bids = Tloc(lg->lg->catalog_bid, 0);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list