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

Function pass1_rse

src/dsql/pass1.cpp:1765–1791  ·  view source on GitHub ↗

Wrapper for pass1_rse_impl. Substitute recursive CTE alias (if needed) and call pass1_rse_impl.

Source from the content-addressed store, hash-verified

1763
1764// Wrapper for pass1_rse_impl. Substitute recursive CTE alias (if needed) and call pass1_rse_impl.
1765static RseNode* pass1_rse(DsqlCompilerScratch* dsqlScratch, RecordSourceNode* input,
1766 ValueListNode* order, RowsClause* rows, bool updateLock, bool skipLocked, USHORT flags)
1767{
1768 string save_alias;
1769 RseNode* rseNode = nodeAs<RseNode>(input);
1770 const bool isRecursive = rseNode && (rseNode->dsqlFlags & RecordSourceNode::DFLAG_RECURSIVE);
1771 AutoSetRestore<USHORT> autoScopeLevel(&dsqlScratch->scopeLevel, dsqlScratch->scopeLevel);
1772
1773 if (isRecursive)
1774 {
1775 fb_assert(dsqlScratch->recursiveCtx);
1776 save_alias = dsqlScratch->recursiveCtx->ctx_alias;
1777
1778 dsqlScratch->recursiveCtx->ctx_alias = *dsqlScratch->getNextCTEAlias();
1779
1780 // ASF: We need to reset the scope level to the same value found in the non-recursive
1781 // part of the query, to verify usage of aggregate functions correctly. See CORE-4322.
1782 dsqlScratch->scopeLevel = dsqlScratch->recursiveCtx->ctx_scope_level;
1783 }
1784
1785 RseNode* ret = pass1_rse_impl(dsqlScratch, input, order, rows, updateLock, skipLocked, flags);
1786
1787 if (isRecursive)
1788 dsqlScratch->recursiveCtx->ctx_alias = save_alias;
1789
1790 return ret;
1791}
1792
1793
1794// Compile a record selection expression. The input node may either be a "select_expression"

Callers 3

PASS1_rseFunction · 0.85
pass1_rse_implFunction · 0.85
pass1_unionFunction · 0.85

Calls 2

pass1_rse_implFunction · 0.85
getNextCTEAliasMethod · 0.80

Tested by

no test coverage detected