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

Function QueryListGetPrimaryStmt

src/backend/utils/cache/plancache.c:1832–1845  ·  view source on GitHub ↗

* QueryListGetPrimaryStmt * Get the "primary" stmt within a list, ie, the one marked canSetTag. * * Returns NULL if no such stmt. If multiple queries within the list are * marked canSetTag, returns the first one. Neither of these cases should * occur in present usages of this function. */

Source from the content-addressed store, hash-verified

1830 * occur in present usages of this function.
1831 */
1832static Query *
1833QueryListGetPrimaryStmt(List *stmts)
1834{
1835 ListCell *lc;
1836
1837 foreach(lc, stmts)
1838 {
1839 Query *stmt = lfirst_node(Query, lc);
1840
1841 if (stmt->canSetTag)
1842 return stmt;
1843 }
1844 return NULL;
1845}
1846
1847/*
1848 * AcquireExecutorLocks: acquire locks needed for execution of a cached plan;

Callers 2

CachedPlanGetTargetListFunction · 0.85

Calls 1

foreachFunction · 0.50

Tested by

no test coverage detected