Changeset: aa5cad7b1104 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/aa5cad7b1104
Modified Files:
        monetdb5/modules/kernel/bat5.c
Branch: Jul2021
Log Message:

Disallow reuse and shrink on 0 width bats (just be defensive)


diffs (35 lines):

diff --git a/monetdb5/modules/kernel/bat5.c b/monetdb5/modules/kernel/bat5.c
--- a/monetdb5/modules/kernel/bat5.c
+++ b/monetdb5/modules/kernel/bat5.c
@@ -854,6 +854,11 @@ BKCshrinkBAT(bat *ret, const bat *bid, c
                uint16_t width = bi.width;
 
                switch (width) {
+               case 0:
+                       bat_iterator_end(&bi);
+                       BBPunfix(b->batCacheid);
+                       BBPunfix(bn->batCacheid);
+                       throw(MAL, "bat.shrink", SQLSTATE(42000) "bat.shrink 
not available for 0 width types");
                case 1:shrinkloop(bte); break;
                case 2:shrinkloop(sht); break;
                case 4:shrinkloop(int); break;
@@ -1014,12 +1019,18 @@ BKCreuseBAT(bat *ret, const bat *bid, co
                                BBPunfix(bn->batCacheid);
                                BBPunfix(b->batCacheid);
                                BBPunfix(bs->batCacheid);
-                               throw(MAL, "bat.shrink", GDK_EXCEPTION);
+                               throw(MAL, "bat.reuse", GDK_EXCEPTION);
                        }
                }
        } else {
                BUN n = 0;
                switch (bi.width) {
+               case 0:
+                       bat_iterator_end(&bi);
+                       BBPunfix(bn->batCacheid);
+                       BBPunfix(b->batCacheid);
+                       BBPunfix(bs->batCacheid);
+                       throw(MAL, "bat.reuse", SQLSTATE(42000) "bat.reuse not 
available for 0 width types");
                case 1:
                        reuseloop(bte);
                        break;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to