diff --git a/src/dsql/BoolNodes.cpp b/src/dsql/BoolNodes.cpp index 5c5e0fcefe..10b29f373f 100644 --- a/src/dsql/BoolNodes.cpp +++ b/src/dsql/BoolNodes.cpp @@ -1324,6 +1324,7 @@ BoolExprNode* ComparativeBoolNode::createRseNode(DsqlCompilerScratch* dsqlScratc const DsqlContextStack::iterator baseUnion(dsqlScratch->unionContext); RseNode* rse = PASS1_rse(dsqlScratch, select_expr, NULL); + rse->flags |= RseNode::FLAG_DSQL_COMPARATIVE; // Create a conjunct to be injected. diff --git a/src/dsql/BoolNodes.h b/src/dsql/BoolNodes.h index 353ad03558..cba313526a 100644 --- a/src/dsql/BoolNodes.h +++ b/src/dsql/BoolNodes.h @@ -179,7 +179,6 @@ public: virtual bool dsqlAggregateFinder(AggregateFinder& visitor) { - fb_assert(blrOp != blr_any && blrOp != blr_ansi_any && blrOp != blr_ansi_all); return visitor.ignoreSubSelects ? false : BoolExprNode::dsqlAggregateFinder(visitor); } diff --git a/src/jrd/RecordSourceNodes.cpp b/src/jrd/RecordSourceNodes.cpp index 928fdd083c..6a41d98be6 100644 --- a/src/jrd/RecordSourceNodes.cpp +++ b/src/jrd/RecordSourceNodes.cpp @@ -2182,14 +2182,14 @@ bool RseNode::dsqlAggregate2Finder(Aggregate2Finder& visitor) return visitor.visit(dsqlWhere) | visitor.visit(dsqlSelectList) | visitor.visit(dsqlStreams); } -bool RseNode::dsqlInvalidReferenceFinder(InvalidReferenceFinder& /*visitor*/) +bool RseNode::dsqlInvalidReferenceFinder(InvalidReferenceFinder& visitor) { - return false; + return (flags & FLAG_DSQL_COMPARATIVE) && RecordSourceNode::dsqlInvalidReferenceFinder(visitor); } -bool RseNode::dsqlSubSelectFinder(SubSelectFinder& /*visitor*/) +bool RseNode::dsqlSubSelectFinder(SubSelectFinder& visitor) { - return true; + return !(flags & FLAG_DSQL_COMPARATIVE) || RecordSourceNode::dsqlSubSelectFinder(visitor); } bool RseNode::dsqlFieldFinder(FieldFinder& visitor) diff --git a/src/jrd/RecordSourceNodes.h b/src/jrd/RecordSourceNodes.h index 0c450034c2..586a8ebb73 100644 --- a/src/jrd/RecordSourceNodes.h +++ b/src/jrd/RecordSourceNodes.h @@ -572,10 +572,11 @@ private: class RseNode : public TypedNode { public: - static const unsigned FLAG_VARIANT = 0x1; // variant (not invariant?) - static const unsigned FLAG_SINGULAR = 0x2; // singleton select - static const unsigned FLAG_WRITELOCK = 0x4; // locked for write - static const unsigned FLAG_SCROLLABLE = 0x8; // scrollable cursor + static const unsigned FLAG_VARIANT = 0x01; // variant (not invariant?) + static const unsigned FLAG_SINGULAR = 0x02; // singleton select + static const unsigned FLAG_WRITELOCK = 0x04; // locked for write + static const unsigned FLAG_SCROLLABLE = 0x08; // scrollable cursor + static const unsigned FLAG_DSQL_COMPARATIVE = 0x10; // transformed from DSQL ComparativeBoolNode explicit RseNode(MemoryPool& pool) : TypedNode(pool),