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

Method addCTEAlias

src/dsql/DsqlCompilerScratch.h:226–231  ·  view source on GitHub ↗

hvlad: each member of recursive CTE can refer to CTE itself (only once) via CTE name or via alias. We need to substitute this aliases when processing CTE member to resolve field names. Therefore we store all aliases in order of occurrence and later use it in backward order (since our parser is right-to-left). Also we put CTE name after all such aliases to distinguish aliases for different CTE's. W

Source from the content-addressed store, hash-verified

224 // We also need to repeat this process if main select expression contains union with
225 // recursive CTE
226 void addCTEAlias(const Firebird::string& alias)
227 {
228 thread_db* tdbb = JRD_get_thread_data();
229 fb_assert(currCteAlias == NULL);
230 cteAliases.add(FB_NEW_POOL(*tdbb->getDefaultPool()) Firebird::string(*tdbb->getDefaultPool(), alias));
231 }
232
233 const Firebird::string* getNextCTEAlias()
234 {

Callers

nothing calls this directly

Calls 3

JRD_get_thread_dataFunction · 0.85
addMethod · 0.45
getDefaultPoolMethod · 0.45

Tested by

no test coverage detected