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

Function CreateQueryDesc

src/backend/tcop/pquery.c:89–131  ·  view source on GitHub ↗

* CreateQueryDesc * * N.B. If sliceTable is non-NULL in the top node of plantree, then * nMotionNodes and nParamExec must be set correctly, as well, and * the QueryDesc will be arranged so that ExecutorStart and ExecutorRun * will handle plan slicing. */

Source from the content-addressed store, hash-verified

87 * will handle plan slicing.
88 */
89QueryDesc *
90CreateQueryDesc(PlannedStmt *plannedstmt,
91 const char *sourceText,
92 Snapshot snapshot,
93 Snapshot crosscheck_snapshot,
94 DestReceiver *dest,
95 ParamListInfo params,
96 QueryEnvironment *queryEnv,
97 int instrument_options)
98{
99 QueryDesc *qd = (QueryDesc *) palloc(sizeof(QueryDesc));
100
101 qd->operation = plannedstmt->commandType; /* operation */
102 qd->plannedstmt = plannedstmt; /* plan */
103 qd->sourceText = sourceText; /* query text */
104 qd->snapshot = RegisterSnapshot(snapshot); /* snapshot */
105 /* RI check snapshot */
106 qd->crosscheck_snapshot = RegisterSnapshot(crosscheck_snapshot);
107 qd->dest = dest; /* output dest */
108 qd->params = params; /* parameter values passed into query */
109 qd->queryEnv = queryEnv;
110 qd->instrument_options = instrument_options; /* instrumentation wanted? */
111
112 /* null these fields until set by ExecutorStart */
113 qd->tupDesc = NULL;
114 qd->estate = NULL;
115 qd->planstate = NULL;
116 qd->totaltime = NULL;
117
118 qd->extended_query = false; /* default value */
119 qd->portal_name = NULL;
120 qd->showstatctx = NULL;
121
122 qd->ddesc = NULL;
123
124 /* not yet executed */
125 qd->already_executed = false;
126
127 if (Gp_role != GP_ROLE_EXECUTE)
128 increment_command_count();
129
130 return qd;
131}
132
133/*
134 * FreeQueryDesc

Callers 13

ProcessQueryFunction · 0.85
PortalStartFunction · 0.85
build_querydescFunction · 0.85
BeginCopyFunction · 0.85
execute_sql_stringFunction · 0.85
refresh_matview_datafillFunction · 0.85
ExecCreateTableAsFunction · 0.85
ExplainOnePlanFunction · 0.85
build_ctas_with_distFunction · 0.85
postquel_startFunction · 0.85
_SPI_execute_planFunction · 0.85

Calls 3

RegisterSnapshotFunction · 0.85
increment_command_countFunction · 0.85
pallocFunction · 0.50

Tested by

no test coverage detected