Changeset: 9931514f6477 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9931514f6477
Modified Files:
        sql/backends/monet5/sql.c
Branch: Dec2016
Log Message:

Don't unfix twice, and don't dereference after unfix.


diffs (33 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -4809,6 +4809,7 @@ SQLvacuum(Client cntxt, MalBlkPtr mb, Ma
        node *o;
        int ordered = 0;
        BUN cnt = 0;
+       BUN dcnt;
 
        if ((msg = getSQLContext(cntxt, mb, &m, NULL)) != NULL)
                return msg;
@@ -4850,17 +4851,17 @@ SQLvacuum(Client cntxt, MalBlkPtr mb, Ma
        if( del == NULL)
                throw(SQL, "sql.vacuum", "Can not access deletion column");
 
-       if (BATcount(del) > 0) {
+       dcnt = BATcount(del);
+       BBPunfix(del->batCacheid);
+       if (dcnt > 0) {
                /* now decide on the algorithm */
-               BBPunfix(del->batCacheid);
                if (ordered) {
-                       if (BATcount(del) > cnt / 20)
+                       if (dcnt > cnt / 20)
                                return SQLshrink(cntxt, mb, stk, pci);
                } else {
                        return SQLreuse(cntxt, mb, stk, pci);
                }
        }
-       BBPunfix(del->batCacheid);
        return MAL_SUCCEED;
 }
 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to