Changeset: b62d15ab704a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b62d15ab704a
Modified Files:
        monetdb5/modules/kernel/algebra.c
Branch: Oct2020
Log Message:

Only use initialized variables.


diffs (30 lines):

diff --git a/monetdb5/modules/kernel/algebra.c 
b/monetdb5/modules/kernel/algebra.c
--- a/monetdb5/modules/kernel/algebra.c
+++ b/monetdb5/modules/kernel/algebra.c
@@ -373,18 +373,19 @@ ALGselectNotNil(bat *result, const bat *
                throw(MAL, "algebra.selectNotNil", SQLSTATE(HY002) 
RUNTIME_OBJECT_MISSING);
 
        if (!b->tnonil) {
-               BAT *bn, *s;
+               BAT *s;
                s = BATselect(b, NULL, ATOMnilptr(b->ttype), NULL, true, true, 
true);
                if (s) {
-                       bn = BATproject(s, b);
+                       BAT *bn = BATproject(s, b);
                        BBPunfix(s->batCacheid);
+                       if (bn) {
+                               BBPunfix(b->batCacheid);
+                               *result = bn->batCacheid;
+                               BBPkeepref(*result);
+                               return MAL_SUCCEED;
+                       }
                }
                BBPunfix(b->batCacheid);
-               if (bn) {
-                       *result = bn->batCacheid;
-                       BBPkeepref(*result);
-                       return MAL_SUCCEED;
-               }
                throw(MAL, "algebra.selectNotNil", GDK_EXCEPTION);
        }
        /* just pass on the result */
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to