From 5174c40bfe6a8c041c5d6056b4795ac12752e21c Mon Sep 17 00:00:00 2001 From: drrtuy Date: Fri, 6 Dec 2019 20:31:23 +0300 Subject: [PATCH] MCOL-1734 This patch fixes the error for NOT IN + subquery when outer query has NULLs in a key column. The if statement that decides whether to add the Row into a result set or not has a logic error thus produces false positives for the case described in MCOL-1734. --- primitives/primproc/batchprimitiveprocessor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/primitives/primproc/batchprimitiveprocessor.cpp b/primitives/primproc/batchprimitiveprocessor.cpp index 7ed4339ae..2fe026142 100644 --- a/primitives/primproc/batchprimitiveprocessor.cpp +++ b/primitives/primproc/batchprimitiveprocessor.cpp @@ -1190,7 +1190,7 @@ void BatchPrimitiveProcessor::executeTupleJoin() */ if (((!found || isNull) && !(joinTypes[j] & (LARGEOUTER | ANTI))) || - ((joinTypes[j] & ANTI) && ((isNull && (joinTypes[j] & MATCHNULLS)) || (found && !isNull)))) + ((joinTypes[j] & ANTI) && ((isNull && !(joinTypes[j] & MATCHNULLS)) || (found && !isNull)))) { //cout << " - not in the result set\n"; break;