Changeset: e67ce51fe0de for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e67ce51fe0de
Modified Files:
sql/storage/bat/bat_storage.c
sql/storage/objectset.c
sql/storage/store.c
sql/test/miscellaneous/Tests/All
Branch: iso
Log Message:
Merged with Jul2021
diffs (truncated from 507 to 300 lines):
diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -3637,7 +3637,7 @@ BATmin_skipnil(BAT *b, void *aggr, bit s
if (BATcheckorderidx(b) ||
(/* DISABLES CODE */ (0) &&
VIEWtparent(b) &&
- (pb = BBPdescriptor(VIEWtparent(b))) != NULL &&
+ (pb = BBP_cache(VIEWtparent(b))) != NULL &&
pb->tbaseoff == b->tbaseoff &&
BATcount(pb) == BATcount(b) &&
pb->hseqbase == b->hseqbase &&
@@ -3668,9 +3668,9 @@ BATmin_skipnil(BAT *b, void *aggr, bit s
}
} else if ((VIEWtparent(b) == 0 ||
(/* DISABLES CODE */ (0) &&
- BATcount(b) ==
BATcount(BBPdescriptor(VIEWtparent(b))))) &&
+ BATcount(b) ==
BATcount(BBP_cache(VIEWtparent(b))))) &&
BATcheckimprints(b)) {
- Imprints *imprints = VIEWtparent(b) ?
BBPdescriptor(VIEWtparent(b))->timprints : b->timprints;
+ Imprints *imprints = VIEWtparent(b) ?
BBP_cache(VIEWtparent(b))->timprints : b->timprints;
int i;
MT_thread_setalgorithm(VIEWtparent(b) ? "using parent
imprints" : "using imprints");
@@ -3751,7 +3751,7 @@ BATmax_skipnil(BAT *b, void *aggr, bit s
if (BATcheckorderidx(b) ||
(/* DISABLES CODE */ (0) &&
VIEWtparent(b) &&
- (pb = BBPdescriptor(VIEWtparent(b))) != NULL &&
+ (pb = BBP_cache(VIEWtparent(b))) != NULL &&
pb->tbaseoff == b->tbaseoff &&
BATcount(pb) == BATcount(b) &&
pb->hseqbase == b->hseqbase &&
@@ -3773,9 +3773,9 @@ BATmax_skipnil(BAT *b, void *aggr, bit s
}
} else if ((VIEWtparent(b) == 0 ||
(/* DISABLES CODE */ (0) &&
- BATcount(b) ==
BATcount(BBPdescriptor(VIEWtparent(b))))) &&
+ BATcount(b) ==
BATcount(BBP_cache(VIEWtparent(b))))) &&
BATcheckimprints(b)) {
- Imprints *imprints = VIEWtparent(b) ?
BBPdescriptor(VIEWtparent(b))->timprints : b->timprints;
+ Imprints *imprints = VIEWtparent(b) ?
BBP_cache(VIEWtparent(b))->timprints : b->timprints;
int i;
MT_thread_setalgorithm(VIEWtparent(b) ? "using parent
imprints" : "using imprints");
@@ -4059,7 +4059,7 @@ doBATgroupquantile(BAT *b, BAT *g, BAT *
if (BATcheckorderidx(b) ||
(/* DISABLES CODE */ (0) &&
VIEWtparent(b) &&
- (pb = BBPdescriptor(VIEWtparent(b))) != NULL &&
+ (pb = BBP_cache(VIEWtparent(b))) != NULL &&
pb->tbaseoff == b->tbaseoff &&
BATcount(pb) == BATcount(b) &&
pb->hseqbase == b->hseqbase &&
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -1929,7 +1929,7 @@ BATkeyed(BAT *b)
BAThash(b) == GDK_SUCCEED) ||
(/* DISABLES CODE */ (0) &&
VIEWtparent(b) != 0 &&
- BATcheckhash(BBPdescriptor(VIEWtparent(b))))) {
+ BATcheckhash(BBP_cache(VIEWtparent(b))))) {
/* we already have a hash table on b, or b is
* persistent and we could create a hash
* table, or b is a view on a bat that already
@@ -1939,7 +1939,7 @@ BATkeyed(BAT *b)
MT_rwlock_rdlock(&b->thashlock);
hs = b->thash;
if (hs == NULL && VIEWtparent(b) != 0) {
- BAT *b2 = BBPdescriptor(VIEWtparent(b));
+ BAT *b2 = BBP_cache(VIEWtparent(b));
lo = b->tbaseoff - b2->tbaseoff;
hs = b2->thash;
}
@@ -2445,7 +2445,7 @@ BATsort(BAT **sorted, BAT **order, BAT *
return GDK_SUCCEED;
}
if (VIEWtparent(b)) {
- pb = BBPdescriptor(VIEWtparent(b));
+ pb = BBP_cache(VIEWtparent(b));
if (/* DISABLES CODE */ (1) ||
b->tbaseoff != pb->tbaseoff ||
BATcount(b) != BATcount(pb) ||
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -2375,9 +2375,10 @@ decref(bat i, bool logical, bool release
if (BBP_refs(i) > 0 ||
(BBP_lrefs(i) > 0 &&
(b == NULL ||
- (BATdirty(b) && (BBP_status(i) & BBPHOT)) ||
- (BBP_status(i) & BBPSYNCING) || /* no swap during (sub)commit */
- (BBP_status(i) & (BBPPERSISTENT | BBPHOT)) == BBPHOT ||
+ BATdirty(b) ||
+ (BBP_status(i) & BBPHOT) ||
+ (BBP_status(i) & BBPSYNCING) ||
+ !(BBP_status(i) & BBPPERSISTENT) ||
GDKinmemory(b->theap->farmid)))) {
/* bat cannot be swapped out */
} else if (b ? b->batSharecnt == 0 : (BBP_status(i) & BBPTMP)) {
diff --git a/gdk/gdk_group.c b/gdk/gdk_group.c
--- a/gdk/gdk_group.c
+++ b/gdk/gdk_group.c
@@ -1010,7 +1010,7 @@ BATgroup_internal(BAT **groups, BAT **ex
BAThash(b) == GDK_SUCCEED) ||
(/* DISABLES CODE */ (0) &&
(parent = VIEWtparent(b)) != 0 &&
- BATcheckhash(BBPdescriptor(parent))))) {
+ BATcheckhash(BBP_cache(parent))))) {
/* we already have a hash table on b, or b is
* persistent and we could create a hash table, or b
* is a view on a bat that already has a hash table;
@@ -1027,7 +1027,7 @@ BATgroup_internal(BAT **groups, BAT **ex
/* b is a view on another bat (b2 for now).
* calculate the bounds [lo, lo+BATcount(b))
* in the parent that b uses */
- BAT *b2 = BBPdescriptor(parent);
+ BAT *b2 = BBP_cache(parent);
MT_rwlock_rdunlock(&b->thashlock);
lo = b->tbaseoff - b2->tbaseoff;
b = b2;
diff --git a/gdk/gdk_imprints.c b/gdk/gdk_imprints.c
--- a/gdk/gdk_imprints.c
+++ b/gdk/gdk_imprints.c
@@ -303,7 +303,7 @@ BATcheckimprints(BAT *b)
if (/* DISABLES CODE */ (0) && VIEWtparent(b)) {
assert(b->timprints == NULL);
- b = BBPdescriptor(VIEWtparent(b));
+ b = BBP_cache(VIEWtparent(b));
}
if (b->timprints == (Imprints *) 1) {
@@ -472,7 +472,7 @@ BATimprints(BAT *b)
/* views always keep null pointer and need to obtain
* the latest imprint from the parent at query time */
s2 = b; /* remember for ACCELDEBUG print */
- b = BBPdescriptor(VIEWtparent(b));
+ b = BBP_cache(VIEWtparent(b));
assert(b);
if (BATcheckimprints(b))
return GDK_SUCCEED;
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -2655,7 +2655,7 @@ hashjoin(BAT **r1p, BAT **r2p, BAT *l, B
} else if (phash) {
/* there is a hash on the parent which we should use */
MT_thread_setalgorithm(swapped ? "hashjoin using parent hash
(swapped)" : "hashjoin using parent hash");
- BAT *b = BBPdescriptor(VIEWtparent(r));
+ BAT *b = BBP_cache(VIEWtparent(r));
TRC_DEBUG(ALGO, "%s(%s): using "
"parent(" ALGOBATFMT ") for hash%s\n",
__func__,
@@ -3222,7 +3222,7 @@ joincost(BAT *r, struct canditer *lci, s
/* average chain length */
rcost *= (double) cnt / nheads;
} else if ((parent = VIEWtparent(r)) != 0 &&
- (b = BBPdescriptor(parent)) != NULL &&
+ (b = BBP_cache(parent)) != NULL &&
BATcheckhash(b)) {
MT_rwlock_rdlock(&b->thashlock);
rhash = prhash = b->thash != NULL;
@@ -3658,7 +3658,7 @@ leftjoin(BAT **r1p, BAT **r2p, BAT *l, B
rcnt = canditer_init(&rci, r, sr);
if ((parent = VIEWtparent(l)) != 0) {
- BAT *b = BBPdescriptor(parent);
+ BAT *b = BBP_cache(parent);
if (l->hseqbase == b->hseqbase &&
BATcount(l) == BATcount(b) &&
ATOMtype(l->ttype) == ATOMtype(b->ttype)) {
@@ -3666,7 +3666,7 @@ leftjoin(BAT **r1p, BAT **r2p, BAT *l, B
}
}
if ((parent = VIEWtparent(r)) != 0) {
- BAT *b = BBPdescriptor(parent);
+ BAT *b = BBP_cache(parent);
if (r->hseqbase == b->hseqbase &&
BATcount(r) == BATcount(b) &&
ATOMtype(r->ttype) == ATOMtype(b->ttype)) {
@@ -4002,14 +4002,14 @@ BATjoin(BAT **r1p, BAT **r2p, BAT *l, BA
canditer_init(&rci, r, sr);
if ((parent = VIEWtparent(l)) != 0) {
- BAT *b = BBPdescriptor(parent);
+ BAT *b = BBP_cache(parent);
if (l->hseqbase == b->hseqbase &&
BATcount(l) == BATcount(b) &&
ATOMtype(l->ttype) == ATOMtype(b->ttype))
l = b;
}
if ((parent = VIEWtparent(r)) != 0) {
- BAT *b = BBPdescriptor(parent);
+ BAT *b = BBP_cache(parent);
if (r->hseqbase == b->hseqbase &&
BATcount(r) == BATcount(b) &&
ATOMtype(r->ttype) == ATOMtype(b->ttype))
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -2654,7 +2654,6 @@ gdk_return
log_tend(logger *lg)
{
logformat l;
- gdk_return res = GDK_SUCCEED;
if (lg->debug & 1)
fprintf(stderr, "#log_tend %d\n", lg->tid);
@@ -2663,8 +2662,7 @@ log_tend(logger *lg)
l.id = lg->tid;
if (lg->flushnow) {
lg->flushnow = 0;
- gdk_return res = logger_commit(lg);
- return res;
+ return logger_commit(lg);
}
if (LOG_DISABLED(lg)) {
@@ -2672,8 +2670,7 @@ log_tend(logger *lg)
return GDK_SUCCEED;
}
- if (res != GDK_SUCCEED ||
- log_write_format(lg, &l) != GDK_SUCCEED ||
+ if (log_write_format(lg, &l) != GDK_SUCCEED ||
mnstr_flush(lg->output_log, MNSTR_FLUSH_DATA) ||
(!(GDKdebug & NOSYNCMASK) && mnstr_fsync(lg->output_log)) ||
new_logfile(lg) != GDK_SUCCEED) {
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -111,7 +111,7 @@ hashselect(BAT *b, BATiter *bi, struct c
*algo = "hashselect";
if (phash) {
- BAT *b2 = BBPdescriptor(VIEWtparent(b));
+ BAT *b2 = BBP_cache(VIEWtparent(b));
*algo = "hashselect on parent";
TRC_DEBUG(ALGO, ALGOBATFMT
" using parent(" ALGOBATFMT ") "
@@ -527,7 +527,7 @@ NAME##_##TYPE(BAT *b, BATiter *bi, struc
assert(lval); \
assert(hval); \
if (use_imprints && /* DISABLES CODE */ (0) && (parent =
VIEWtparent(b))) { \
- BAT *pbat = BBPdescriptor(parent); \
+ BAT *pbat = BBP_cache(parent); \
assert(pbat); \
/* NOTE: this code is incorrect since pbat could be changed while */ \
/* we're using the heap, but this code is disabled, so we don't */ \
@@ -1564,7 +1564,7 @@ BATselect(BAT *b, BAT *s, const void *tl
BAT *view = NULL;
if (/* DISABLES CODE */ (0) && VIEWtparent(b) &&
!BATcheckorderidx(b)) {
view = b;
- b = BBPdescriptor(VIEWtparent(b));
+ b = BBP_cache(VIEWtparent(b));
}
/* Is query selective enough to use the ordered index ? */
/* TODO: Test if this heuristic works in practice */
@@ -2038,7 +2038,7 @@ rangejoin(BAT *r1, BAT *r2, BAT *l, BAT
(BATcheckorderidx(l) || (/* DISABLES CODE */ (0) && VIEWtparent(l)
&& BATcheckorderidx(BBPquickdesc(VIEWtparent(l), false))))) {
use_orderidx = true;
if (/* DISABLES CODE */ (0) && VIEWtparent(l) &&
!BATcheckorderidx(l)) {
- l = BBPdescriptor(VIEWtparent(l));
+ l = BBP_cache(VIEWtparent(l));
}
}
diff --git a/sql/benchmarks/tpcds/Tests/one.test.in
b/sql/benchmarks/tpcds/Tests/one.test.in
--- a/sql/benchmarks/tpcds/Tests/one.test.in
+++ b/sql/benchmarks/tpcds/Tests/one.test.in
@@ -1,4 +1,7 @@
statement ok
+select sys.debug(0)
+
+statement ok
start transaction
statement ok
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
@@ -31,6 +31,8 @@ static int commit_create_del(sql_trans *
static int tc_gc_col( sql_store Store, sql_change *c, ulng oldest);
static int tc_gc_idx( sql_store Store, sql_change *c, ulng oldest);
static int tc_gc_del( sql_store Store, sql_change *c, ulng oldest);
+static int tc_gc_drop_col( sql_store Store, sql_change *c, ulng oldest);
+static int tc_gc_drop_idx( sql_store Store, sql_change *c, ulng oldest);
static int merge_delta( sql_delta *obat);
@@ -2698,7 +2700,7 @@ drop_col(sql_trans *tr, sql_column *c)
{
assert(!isNew(c) && !isTempTable(c->t));
sql_delta *d = ATOMIC_PTR_GET(&c->data);
- trans_add(tr, &c->base, d, &tc_gc_col, &commit_destroy_del,
&log_destroy_col);
+ trans_add(tr, &c->base, d, &tc_gc_drop_col, &commit_destroy_del,
&log_destroy_col);
return LOG_OK;
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list