Changeset: e97cd4d87b96 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e97cd4d87b96
Modified Files:
        gdk/gdk.h
        gdk/gdk_strimps.c
        monetdb5/mal/mal_profiler.c
        monetdb5/modules/mal/remote.c
        sql/storage/bat/bat_storage.c
Branch: default
Log Message:

Merge with Dec2023 branch.


diffs (114 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -900,9 +900,10 @@ gdk_export size_t HEAPmemsize(Heap *h);
 gdk_export void HEAPdecref(Heap *h, bool remove);
 gdk_export void HEAPincref(Heap *h);
 
-#define isVIEW(x)                                                      \
-       (((x)->theap && (x)->theap->parentid != (x)->batCacheid) ||     \
-        ((x)->tvheap && (x)->tvheap->parentid != (x)->batCacheid))
+#define VIEWtparent(x) ((x)->theap == NULL || (x)->theap->parentid == 
(x)->batCacheid ? 0 : (x)->theap->parentid)
+#define VIEWvtparent(x)        ((x)->tvheap == NULL || (x)->tvheap->parentid 
== (x)->batCacheid ? 0 : (x)->tvheap->parentid)
+
+#define isVIEW(x)      (VIEWtparent(x) != 0 || VIEWvtparent(x) != 0)
 
 /*
  * @+ BAT Buffer Pool
@@ -1083,7 +1084,7 @@ bat_iterator_nolock(BAT *b)
 {
        /* does not get matched by bat_iterator_end */
        if (b) {
-               bool isview = isVIEW(b);
+               bool isview = VIEWtparent(b);
                return (BATiter) {
                        .b = b,
                        .h = b->theap,
@@ -2162,9 +2163,6 @@ gdk_export void VIEWbounds(BAT *b, BAT *
                }                                                       \
        } while (false)
 
-#define VIEWtparent(x) ((x)->theap == NULL || (x)->theap->parentid == 
(x)->batCacheid ? 0 : (x)->theap->parentid)
-#define VIEWvtparent(x)        ((x)->tvheap == NULL || (x)->tvheap->parentid 
== (x)->batCacheid ? 0 : (x)->tvheap->parentid)
-
 /*
  * @+ BAT Iterators
  *  @multitable @columnfractions 0.15 0.7
diff --git a/gdk/gdk_strimps.c b/gdk/gdk_strimps.c
--- a/gdk/gdk_strimps.c
+++ b/gdk/gdk_strimps.c
@@ -551,7 +551,7 @@ STRMPfilter(BAT *b, BAT *s, const char *
 
        TRC_DEBUG_IF(ACCELERATOR) t0 = GDKusec();
 
-       if (isVIEW(b)) {
+       if (VIEWtparent(b)) {
                pb = BATdescriptor(VIEWtparent(b));
                if (pb == NULL)
                        return NULL;
diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -396,7 +396,7 @@ prepareMalEvent(Client cntxt, MalBlkPtr 
                                                 * without further locking */
                                                MT_lock_unset(&d->theaplock);
                                                cnt = di.count;
-                                               if (isVIEW(d)) {
+                                               if (VIEWtparent(d)) {
                                                        BAT *v = 
BBP_desc(VIEWtparent(d));
                                                        
MT_lock_set(&v->theaplock);
                                                        bool vtransient = 
v->batTransient;
diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c
--- a/monetdb5/modules/mal/remote.c
+++ b/monetdb5/modules/mal/remote.c
@@ -1546,7 +1546,7 @@ RMTbincopyto(Client cntxt, MalBlkPtr mb,
 
        sendtheap = b->ttype != TYPE_void;
        sendtvheap = sendtheap && b->tvheap;
-       if (isVIEW(b) && sendtvheap && VIEWvtparent(b)
+       if (sendtvheap && VIEWvtparent(b)
                && BATcount(b) < BATcount(BBP_desc(VIEWvtparent(b)))) {
                if ((b = BATdescriptor(bid)) == NULL) {
                        BBPunfix(bid);
diff --git a/sql/backends/monet5/sql_statistics.c 
b/sql/backends/monet5/sql_statistics.c
--- a/sql/backends/monet5/sql_statistics.c
+++ b/sql/backends/monet5/sql_statistics.c
@@ -183,7 +183,7 @@ sql_analyze(Client cntxt, MalBlkPtr mb, 
                                        int access = c->storage_type && 
c->storage_type[0] == 'D' ? RD_EXT : RDONLY;
                                        if (!(b = 
store->storage_api.bind_col(tr, c, access)))
                                                continue; /* At the moment we 
ignore the error, but maybe we can change this */
-                                       if (isVIEW(b)) { /* If it is a view get 
the parent BAT */
+                                       if (VIEWtparent(b)) { /* If it is a 
view get the parent BAT */
                                                BAT *nb = 
BATdescriptor(VIEWtparent(b));
                                                BBPunfix(b->batCacheid);
                                                b = nb;
@@ -370,7 +370,7 @@ sql_statistics(Client cntxt, MalBlkPtr m
                                                                goto bailout;
                                                        }
                                                        BATiter rei = 
bat_iterator(re);
-                                                       if (isVIEW(re)) { /* If 
it is a view get the parent BAT */
+                                                       if (VIEWtparent(re)) { 
/* If it is a view get the parent BAT */
                                                                BAT *nb = 
BATdescriptor(VIEWtparent(re));
                                                                
BBPunfix(re->batCacheid);
                                                                re = nb;
@@ -423,7 +423,7 @@ sql_statistics(Client cntxt, MalBlkPtr m
                                                                        msg = 
createException(SQL, "sql.statistics", SQLSTATE(HY005) "Cannot access column 
descriptor");
                                                                        goto 
bailout;
                                                                }
-                                                               if (isVIEW(fb)) 
{ /* If it is a view get the parent BAT */
+                                                               if 
(VIEWtparent(fb)) { /* If it is a view get the parent BAT */
                                                                        BAT *nb 
= BATdescriptor(VIEWtparent(fb));
                                                                        
BBPunfix(fb->batCacheid);
                                                                        fb = nb;
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
@@ -2719,7 +2719,7 @@ dcount_col(sql_trans *tr, sql_column *c)
 static BAT *
 bind_no_view(BAT *b, bool quick)
 {
-       if (isVIEW(b)) { /* If it is a view get the parent BAT */
+       if (VIEWtparent(b)) { /* If it is a view get the parent BAT */
                BAT *nb = BBP_desc(VIEWtparent(b));
                bat_destroy(b);
                if (!(b = quick ? quick_descriptor(nb->batCacheid) : 
temp_descriptor(nb->batCacheid)))
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to