From 8b485a455c70d1eaf201192b46b5dd5fdf5ea386 Mon Sep 17 00:00:00 2001 From: Dmitry Yemanov Date: Wed, 13 Oct 2021 07:23:20 +0300 Subject: [PATCH] Constness --- src/dsql/BoolNodes.h | 8 ++++---- src/dsql/ExprNodes.cpp | 4 ++-- src/dsql/ExprNodes.h | 16 ++++++++-------- src/dsql/Nodes.h | 14 +++++++------- src/jrd/opt.cpp | 2 +- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/dsql/BoolNodes.h b/src/dsql/BoolNodes.h index 5de883f308..9235082ef3 100644 --- a/src/dsql/BoolNodes.h +++ b/src/dsql/BoolNodes.h @@ -95,7 +95,7 @@ public: virtual BoolExprNode* dsqlPass(DsqlCompilerScratch* dsqlScratch); virtual void genBlr(DsqlCompilerScratch* dsqlScratch); - virtual bool possiblyUnknown() + virtual bool possiblyUnknown() const { return blrOp == blr_equiv ? true : BoolExprNode::possiblyUnknown(); } @@ -143,7 +143,7 @@ public: virtual BoolExprNode* dsqlPass(DsqlCompilerScratch* dsqlScratch); virtual void genBlr(DsqlCompilerScratch* dsqlScratch); - virtual bool possiblyUnknown() + virtual bool possiblyUnknown() const { return true; } @@ -176,7 +176,7 @@ public: virtual BoolExprNode* dsqlPass(DsqlCompilerScratch* dsqlScratch); virtual void genBlr(DsqlCompilerScratch* dsqlScratch); - virtual bool possiblyUnknown() + virtual bool possiblyUnknown() const { return true; } @@ -224,7 +224,7 @@ public: return true; } - virtual bool possiblyUnknown() + virtual bool possiblyUnknown() const { return true; } diff --git a/src/dsql/ExprNodes.cpp b/src/dsql/ExprNodes.cpp index 3f367020ce..0ae1dc4740 100644 --- a/src/dsql/ExprNodes.cpp +++ b/src/dsql/ExprNodes.cpp @@ -289,7 +289,7 @@ bool ExprNode::sameAs(const ExprNode* other, bool ignoreStreams) const return true; } -bool ExprNode::possiblyUnknown() +bool ExprNode::possiblyUnknown() const { NodeRefsHolder holder; getChildren(holder, false); @@ -303,7 +303,7 @@ bool ExprNode::possiblyUnknown() return false; } -bool ExprNode::unmappable(const MapNode* mapNode, StreamType shellStream) +bool ExprNode::unmappable(const MapNode* mapNode, StreamType shellStream) const { NodeRefsHolder holder; getChildren(holder, false); diff --git a/src/dsql/ExprNodes.h b/src/dsql/ExprNodes.h index b9d998ff68..80505c69f3 100644 --- a/src/dsql/ExprNodes.h +++ b/src/dsql/ExprNodes.h @@ -312,7 +312,7 @@ public: virtual ValueExprNode* pass2(thread_db* tdbb, CompilerScratch* csb); virtual dsc* execute(thread_db* tdbb, jrd_req* request) const; - virtual bool possiblyUnknown() + virtual bool possiblyUnknown() const { return true; } @@ -776,7 +776,7 @@ public: dsqlDesc = desc; } - virtual bool possiblyUnknown() + virtual bool possiblyUnknown() const { return false; } @@ -787,7 +787,7 @@ public: streamList.add(fieldStream); } - virtual bool unmappable(const MapNode* /*mapNode*/, StreamType /*shellStream*/) + virtual bool unmappable(const MapNode* /*mapNode*/, StreamType /*shellStream*/) const { return true; } @@ -1642,7 +1642,7 @@ public: virtual void genBlr(DsqlCompilerScratch* dsqlScratch); virtual void make(DsqlCompilerScratch* dsqlScratch, dsc* desc); - virtual bool possiblyUnknown() + virtual bool possiblyUnknown() const { return false; } @@ -1900,12 +1900,12 @@ public: virtual bool dsqlFieldFinder(FieldFinder& visitor); virtual ValueExprNode* dsqlFieldRemapper(FieldRemapper& visitor); - virtual bool unmappable(const MapNode* /*mapNode*/, StreamType /*shellStream*/) + virtual bool unmappable(const MapNode* /*mapNode*/, StreamType /*shellStream*/) const { return false; } - virtual bool possiblyUnknown() + virtual bool possiblyUnknown() const { return true; } @@ -2114,7 +2114,7 @@ public: virtual void genBlr(DsqlCompilerScratch* dsqlScratch); virtual void make(DsqlCompilerScratch* dsqlScratch, dsc* desc); - virtual bool possiblyUnknown() + virtual bool possiblyUnknown() const { return true; } @@ -2163,7 +2163,7 @@ public: virtual void genBlr(DsqlCompilerScratch* dsqlScratch); virtual void make(DsqlCompilerScratch* dsqlScratch, dsc* desc); - virtual bool possiblyUnknown() + virtual bool possiblyUnknown() const { return true; } diff --git a/src/dsql/Nodes.h b/src/dsql/Nodes.h index 931e2564a8..9901dae13f 100644 --- a/src/dsql/Nodes.h +++ b/src/dsql/Nodes.h @@ -659,15 +659,15 @@ public: } // Check if expression could return NULL or expression can turn NULL into a true/false. - virtual bool possiblyUnknown(); + virtual bool possiblyUnknown() const; // Verify if this node is allowed in an unmapped boolean. - virtual bool unmappable(const MapNode* mapNode, StreamType shellStream); + virtual bool unmappable(const MapNode* mapNode, StreamType shellStream) const; // Return all streams referenced by the expression. virtual void collectStreams(SortedStreamList& streamList) const; - virtual bool findStream(StreamType stream) + virtual bool containsStream(StreamType stream) const { SortedStreamList streams; collectStreams(streams); @@ -1027,7 +1027,7 @@ public: virtual AggNode* pass2(thread_db* tdbb, CompilerScratch* csb); - virtual bool possiblyUnknown() + virtual bool possiblyUnknown() const { return true; } @@ -1039,7 +1039,7 @@ public: return; } - virtual bool unmappable(const MapNode* /*mapNode*/, StreamType /*shellStream*/) + virtual bool unmappable(const MapNode* /*mapNode*/, StreamType /*shellStream*/) const { return false; } @@ -1160,12 +1160,12 @@ public: fb_assert(false); } - virtual bool possiblyUnknown() + virtual bool possiblyUnknown() const { return true; } - virtual bool unmappable(const MapNode* /*mapNode*/, StreamType /*shellStream*/) + virtual bool unmappable(const MapNode* /*mapNode*/, StreamType /*shellStream*/) const { return false; } diff --git a/src/jrd/opt.cpp b/src/jrd/opt.cpp index 3aa0dfef1f..d212417ed1 100644 --- a/src/jrd/opt.cpp +++ b/src/jrd/opt.cpp @@ -2413,7 +2413,7 @@ static RecordSource* gen_retrieval(thread_db* tdbb, // that are local to this stream. The remaining ones are left in piece // as possible candidates for a merge/hash join. - if ((inversion && node->findStream(stream)) || + if ((inversion && node->containsStream(stream)) || (!inversion && node->computable(csb, stream, true))) { compose(*tdbb->getDefaultPool(), &boolean, node);