@@ -2058,16 +2058,20 @@ BoolExprNode* RseBoolNode::convertNeqAllToNotAny(thread_db* tdbb, CompilerScratc
20582058
20592059 andNode->arg1 = missNode;
20602060
2061+ RseNode* newInnerRse1 = innerRse->clone (csb->csb_pool );
2062+ newInnerRse1->flags |= RseNode::FLAG_SUB_QUERY;
2063+
20612064 RseBoolNode* rseBoolNode = FB_NEW_POOL (csb->csb_pool ) RseBoolNode (csb->csb_pool , blr_any);
2062- rseBoolNode->rse = innerRse ;
2065+ rseBoolNode->rse = newInnerRse1 ;
20632066 rseBoolNode->ownSavepoint = this ->ownSavepoint ;
20642067
20652068 andNode->arg2 = rseBoolNode;
20662069
2067- RseNode* newInnerRse = innerRse->clone (csb->csb_pool );
2070+ RseNode* newInnerRse2 = innerRse->clone (csb->csb_pool );
2071+ newInnerRse2->flags |= RseNode::FLAG_SUB_QUERY;
20682072
20692073 rseBoolNode = FB_NEW_POOL (csb->csb_pool ) RseBoolNode (csb->csb_pool , blr_any);
2070- rseBoolNode->rse = newInnerRse ;
2074+ rseBoolNode->rse = newInnerRse2 ;
20712075 rseBoolNode->ownSavepoint = this ->ownSavepoint ;
20722076
20732077 orNode->arg2 = rseBoolNode;
@@ -2083,16 +2087,16 @@ BoolExprNode* RseBoolNode::convertNeqAllToNotAny(thread_db* tdbb, CompilerScratc
20832087 outerRseNeq->blrOp = blr_eql;
20842088
20852089 // If there was a boolean on the stream, append (AND) the new one
2086- if (newInnerRse ->rse_boolean )
2090+ if (newInnerRse2 ->rse_boolean )
20872091 {
20882092 andNode = FB_NEW_POOL (csb->csb_pool ) BinaryBoolNode (csb->csb_pool , blr_and);
20892093
2090- andNode->arg1 = newInnerRse ->rse_boolean ;
2094+ andNode->arg1 = newInnerRse2 ->rse_boolean ;
20912095 andNode->arg2 = boolean;
20922096 boolean = andNode;
20932097 }
20942098
2095- newInnerRse ->rse_boolean = boolean;
2099+ newInnerRse2 ->rse_boolean = boolean;
20962100
20972101 SubExprNodeCopier copier (csb->csb_pool , csb);
20982102 return copier.copy (tdbb, static_cast <BoolExprNode*>(newNode));
0 commit comments