MCPcopy Create free account
hub / github.com/apache/cloudberry / GetRTEByRangeTablePosn

Function GetRTEByRangeTablePosn

src/backend/parser/parse_relation.c:525–537  ·  view source on GitHub ↗

* Given an RT index and nesting depth, find the corresponding RTE. * (Note that the RTE need not be in the query's namespace.) */

Source from the content-addressed store, hash-verified

523 * (Note that the RTE need not be in the query's namespace.)
524 */
525RangeTblEntry *
526GetRTEByRangeTablePosn(ParseState *pstate,
527 int varno,
528 int sublevels_up)
529{
530 while (sublevels_up-- > 0)
531 {
532 pstate = pstate->parentParseState;
533 Assert(pstate != NULL);
534 }
535 Assert(varno > 0 && varno <= list_length(pstate->p_rtable));
536 return rt_fetch(varno, pstate->p_rtable);
537}
538
539/*
540 * Fetch the CTE for a CTE-reference RTE.

Callers 4

count_rowexpr_columnsFunction · 0.85
unknown_attributeFunction · 0.85
markTargetListOriginFunction · 0.85
expandRecordVariableFunction · 0.85

Calls 1

list_lengthFunction · 0.85

Tested by

no test coverage detected