Changeset: d2e0fab0d429 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d2e0fab0d429
Modified Files:
        sql/backends/monet5/sql_basket.c
Branch: trails
Log Message:

Don't leak bat descriptors


diffs (32 lines):

diff --git a/sql/backends/monet5/sql_basket.c b/sql/backends/monet5/sql_basket.c
--- a/sql/backends/monet5/sql_basket.c
+++ b/sql/backends/monet5/sql_basket.c
@@ -625,15 +625,25 @@ BSKTupdate(Client cntxt, MalBlkPtr mb, M
        }
 
        bskt = BSKTlocate(sname,tname);
-       if( bskt == 0)
+       if( bskt == 0) {
+               BBPunfix(rid->batCacheid);
+               BBPunfix(bval->batCacheid);
                throw(SQL, "basket.update",SQLSTATE(HY005) "Cannot access 
basket descriptor %s.%s\n",sname,tname);
+       }
        bn = BSKTbindColumn(sname,tname,cname);
 
        if( bn){
-               if( BATreplace(bn, rid, bval, TRUE) != GDK_SUCCEED)
+               if( BATreplace(bn, rid, bval, TRUE) != GDK_SUCCEED) {
+                       BBPunfix(rid->batCacheid);
+                       BBPunfix(bval->batCacheid);
                        throw(SQL, "basket.update",SQLSTATE(HY005) "Cannot 
access basket descriptor %s.%s\n",sname,tname);
+               }
                BATsettrivprop(bn);
-       } else throw(SQL, "basket.update",SQLSTATE(3F000) "Cannot access target 
column %s.%s.%s\n",sname,tname,cname);
+       } else {
+               BBPunfix(rid->batCacheid);
+               BBPunfix(bval->batCacheid);
+               throw(SQL, "basket.update",SQLSTATE(3F000) "Cannot access 
target column %s.%s.%s\n",sname,tname,cname);
+       }
        
        BBPunfix(rid->batCacheid);
        BBPunfix(bval->batCacheid);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to