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

Method addCTEs

src/dsql/DsqlCompilerScratch.cpp:594–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

592}
593
594void DsqlCompilerScratch::addCTEs(WithClause* withClause)
595{
596 if (ctes.getCount())
597 {
598 ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
599 // WITH clause can't be nested
600 Arg::Gds(isc_dsql_cte_nested_with));
601 }
602
603 if (withClause->recursive)
604 flags |= DsqlCompilerScratch::FLAG_RECURSIVE_CTE;
605
606 const SelectExprNode* const* end = withClause->end();
607
608 for (SelectExprNode* const* cte = withClause->begin(); cte != end; ++cte)
609 {
610 if (withClause->recursive)
611 {
612 currCtes.push(*cte);
613 PsqlChanger changer(this, false);
614 ctes.add(pass1RecursiveCte(*cte));
615 currCtes.pop();
616
617 // Add CTE name into CTE aliases stack. It allows later to search for
618 // aliases of given CTE.
619 addCTEAlias((*cte)->alias);
620 }
621 else
622 ctes.add(*cte);
623 }
624}
625
626SelectExprNode* DsqlCompilerScratch::findCTE(const MetaName& name)
627{

Callers 1

pass1_rse_implFunction · 0.80

Calls 9

ERRD_postFunction · 0.85
GdsClass · 0.85
NumClass · 0.85
getCountMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
pushMethod · 0.45
addMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected