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

Function postquel_getnext

src/backend/executor/functions.c:1007–1039  ·  view source on GitHub ↗

Run one execution_state; either to completion or to first result row */ Returns true if we ran to completion */

Source from the content-addressed store, hash-verified

1005/* Run one execution_state; either to completion or to first result row */
1006/* Returns true if we ran to completion */
1007static bool
1008postquel_getnext(execution_state *es, SQLFunctionCachePtr fcache)
1009{
1010 bool result;
1011
1012 if (es->qd->operation == CMD_UTILITY)
1013 {
1014 ProcessUtility(es->qd->plannedstmt,
1015 fcache->src,
1016 false,
1017 PROCESS_UTILITY_QUERY,
1018 es->qd->params,
1019 es->qd->queryEnv,
1020 es->qd->dest,
1021 NULL);
1022 result = true; /* never stops early */
1023 }
1024 else
1025 {
1026 /* Run regular commands to completion unless lazyEval */
1027 uint64 count = (es->lazyEval) ? 1 : 0;
1028
1029 ExecutorRun(es->qd, ForwardScanDirection, count, !fcache->returnsSet || !es->lazyEval);
1030
1031 /*
1032 * If we requested run to completion OR there was no tuple returned,
1033 * command must be complete.
1034 */
1035 result = (count == 0 || es->qd->estate->es_processed == 0);
1036 }
1037
1038 return result;
1039}
1040
1041/* Shut down execution of one execution_state node */
1042static void

Callers 1

fmgr_sqlFunction · 0.85

Calls 2

ProcessUtilityFunction · 0.85
ExecutorRunFunction · 0.85

Tested by

no test coverage detected