Changeset: 23f5b65dfb17 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/23f5b65dfb17
Modified Files:
        monetdb5/modules/mal/remote.c
        sql/test/SQLancer/Tests/sqlancer19.SQL.py
Branch: default
Log Message:

Don't send any heap data on void bats.

Please someone review this. I am not completely sure.


diffs (52 lines):

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
@@ -1524,7 +1524,7 @@ static str RMTbincopyto(Client cntxt, Ma
        if (BBPfix(bid) <= 0)
                throw(MAL, "remote.bincopyto", MAL_MALLOC_FAIL);
 
-       sendtheap = b->ttype != TYPE_void && b->tvarsized;
+       sendtheap = !BATtvoid(b) && b->tvarsized;
        if (isVIEW(b) && sendtheap && VIEWvtparent(b) && BATcount(b) < 
BATcount(BBP_cache(VIEWvtparent(b)))) {
                if ((b = BATdescriptor(bid)) == NULL) {
                        BBPunfix(bid);
@@ -1560,10 +1560,10 @@ static str RMTbincopyto(Client cntxt, Ma
                        BATtdense(v),
                        v->batCount,
                        BATtvoid(v) ? 0 : (size_t)v->batCount << v->tshift,
-                       sendtheap && v->batCount > 0 ? v->tvheap->free : 0
+                       sendtheap && !BATtvoid(v) && v->batCount > 0 ? 
v->tvheap->free : 0
                        );
 
-       if (v->batCount > 0) {
+       if (!BATtvoid(v) && v->batCount > 0) {
                BATiter vi = bat_iterator(v);
                mnstr_write(cntxt->fdout, /* tail */
                                        vi.base, vi.count * vi.width, 1);
@@ -1571,7 +1571,7 @@ static str RMTbincopyto(Client cntxt, Ma
                        mnstr_write(cntxt->fdout, /* theap */
                                                vi.vh->base, vi.vhfree, 1);
                bat_iterator_end(&vi);
-       }
+       }       
        /* flush is done by the calling environment (MAL) */
 
        if (b != v)
diff --git a/sql/test/SQLancer/Tests/sqlancer19.SQL.py 
b/sql/test/SQLancer/Tests/sqlancer19.SQL.py
--- a/sql/test/SQLancer/Tests/sqlancer19.SQL.py
+++ b/sql/test/SQLancer/Tests/sqlancer19.SQL.py
@@ -204,6 +204,14 @@ with SQLTestCase() as cli:
     cli.execute("create view v0(vc0, vc1) as (values (interval '2' second, 
0.5));").assertSucceeded()
     cli.execute("select 1 from rt1, v0, rt3 where \"right_shift_assign\"(inet 
'150.117.219.77', inet '1.188.46.21/12');") \
         .assertSucceeded().assertDataResultMatch([])
+    cli.execute("select 1 from t1, v0, t3 where \"right_shift_assign\"(inet 
'150.117.219.77', inet '1.188.46.21/12');") \
+        .assertSucceeded().assertDataResultMatch([])
+    cli.execute("create view v1(vc0) as (select greatest(sql_sub(time 
'01:00:00', interval '0' second), time '01:00:00') from t3 where false);") \
+        .assertSucceeded()
+    cli.execute("select 1 from (select distinct 1 from v1, rt3) as v1(vc1) 
where sql_min(true, true);") \
+        .assertSucceeded().assertDataResultMatch([])
+    cli.execute("select 1 from (select distinct 1 from v1, t3) as v1(vc1) 
where sql_min(true, true);") \
+        .assertSucceeded().assertDataResultMatch([])
     cli.execute("ROLLBACK;")
 
     cli.execute("""
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to