From 1c928de01f675553ac9fabd1737e3c7690b39e5d Mon Sep 17 00:00:00 2001
From: Michael Goulet <mgoulet@caltech.edu>
Date: Wed, 20 Feb 2019 22:01:47 -0800
Subject: [PATCH] Apply NOT to InSubqueryOperator

It turns out that we never correctly implemented the INVERT flag to the
InSubqueryOperator. It was added to the toString implementation, but not
the evaluation!
---
 .../edu/caltech/nanodb/expressions/InSubqueryOperator.java   | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/main/java/edu/caltech/nanodb/expressions/InSubqueryOperator.java b/src/main/java/edu/caltech/nanodb/expressions/InSubqueryOperator.java
index be255d5..2966e4d 100644
--- a/src/main/java/edu/caltech/nanodb/expressions/InSubqueryOperator.java
+++ b/src/main/java/edu/caltech/nanodb/expressions/InSubqueryOperator.java
@@ -106,11 +106,10 @@ public class InSubqueryOperator extends SubqueryOperator {
                 break;
 
             if (TupleComparator.areTuplesEqual(valueTup, subqueryTup))
-                return Boolean.TRUE;
+                return invert ? false : true;
         }
 
-        // If we got here, nothing matched.
-        return Boolean.FALSE;
+        return invert ? true : false;
     }
 
 
-- 
GitLab