Bugfix for negative matches
authorsenator <lebbeous@esilibrary.com>
Fri, 22 Apr 2011 16:12:30 +0000 (12:12 -0400)
committersenator <lebbeous@esilibrary.com>
Fri, 22 Apr 2011 16:12:30 +0000 (12:12 -0400)
Open-ILS/src/sql/Pg/012.schema.vandelay.sql

index 687f161..eeb8e2a 100644 (file)
@@ -681,9 +681,7 @@ BEGIN
     IF node.bool_op IS NOT NULL THEN
         RETURN node.bool_op;
     ELSE
-        RETURN '(n' || node.id::TEXT || '.id IS ' ||
-            (CASE WHEN node.negate THEN '' ELSE 'NOT ' END) ||  -- sic!
-            'NULL)';
+        RETURN '(n' || node.id::TEXT || '.id IS NOT NULL)';
     END IF;
 END;
 $$ LANGUAGE PLPGSQL;