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

Function AddPreassignedENR

src/backend/utils/misc/queryenvironment.c:106–128  ·  view source on GitHub ↗

* Add preassigned EphemeralNamedRelationInfo objects to the given query environment. * * Parameters: * - queryEnv: the query environment * - enrs: a list of EphemeralNamedRelationInfo objects to add */

Source from the content-addressed store, hash-verified

104 * - enrs: a list of EphemeralNamedRelationInfo objects to add
105 */
106void
107AddPreassignedENR(QueryEnvironment *queryEnv, List* enrs)
108{
109 ListCell *lc;
110
111 foreach(lc, enrs)
112 {
113 EphemeralNamedRelationInfo *enrinfo = (EphemeralNamedRelationInfo *) lfirst(lc);
114
115 EphemeralNamedRelation enr = (EphemeralNamedRelation) palloc0(sizeof(EphemeralNamedRelationData));
116 enr->md.name = enrinfo->name;
117 enr->md.reliddesc = enrinfo->reliddesc;
118 enr->md.tupdesc = enrinfo->tuple;
119 enr->md.enrtype = enrinfo->enrtype;
120 enr->md.enrtuples = enrinfo->enrtuples;
121 enr->reldata = NULL;
122 if (get_visible_ENR_metadata(queryEnv, enr->md.name) == NULL)
123 register_ENR(queryEnv, enr);
124 else
125 pfree(enr);
126 }
127 return;
128}
129
130/*
131 * Fill the QueryDispatchDesc structure with information from the given query environment.

Callers 1

standard_ExecutorStartFunction · 0.85

Calls 5

get_visible_ENR_metadataFunction · 0.85
register_ENRFunction · 0.85
foreachFunction · 0.50
palloc0Function · 0.50
pfreeFunction · 0.50

Tested by

no test coverage detected