MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / dsqlAggregate2Finder

Method dsqlAggregate2Finder

src/dsql/AggNodes.cpp:193–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193bool AggNode::dsqlAggregate2Finder(Aggregate2Finder& visitor)
194{
195 if (visitor.windowOnly)
196 return false;
197
198 bool found = false;
199 FieldFinder fieldFinder(visitor.getPool(), visitor.checkScopeLevel, visitor.matchType);
200
201 NodeRefsHolder holder(visitor.getPool());
202 getChildren(holder, true);
203
204 for (auto i : holder.refs)
205 found |= fieldFinder.visit(*i);
206
207 if (!fieldFinder.getField())
208 {
209 // For example COUNT(*) is always same scope_level (node->nod_count = 0)
210 // Normaly COUNT(*) is the only way to come here but something stupid
211 // as SUM(5) is also possible.
212 // If currentScopeLevelEqual is false scopeLevel is always higher
213 switch (visitor.matchType)
214 {
215 case FIELD_MATCH_TYPE_LOWER_EQUAL:
216 case FIELD_MATCH_TYPE_EQUAL:
217 return visitor.currentScopeLevelEqual;
218
219 ///case FIELD_MATCH_TYPE_HIGHER_EQUAL:
220 /// return true;
221
222 case FIELD_MATCH_TYPE_LOWER: // Not used here
223 ///case FIELD_MATCH_TYPE_HIGHER:
224 fb_assert(false);
225 return false;
226
227 default:
228 fb_assert(false);
229 }
230 }
231
232 return found;
233}
234
235bool AggNode::dsqlInvalidReferenceFinder(InvalidReferenceFinder& visitor)
236{

Callers 1

visitMethod · 0.45

Calls 2

visitMethod · 0.45
getFieldMethod · 0.45

Tested by

no test coverage detected