* Create a QueryDesc for the PlannedStmt we are to execute, and return it. */
| 1230 | * Create a QueryDesc for the PlannedStmt we are to execute, and return it. |
| 1231 | */ |
| 1232 | static QueryDesc * |
| 1233 | ExecParallelGetQueryDesc(shm_toc *toc, DestReceiver *receiver, |
| 1234 | int instrument_options) |
| 1235 | { |
| 1236 | char *pstmtspace; |
| 1237 | char *paramspace; |
| 1238 | PlannedStmt *pstmt; |
| 1239 | ParamListInfo paramLI; |
| 1240 | char *queryString; |
| 1241 | |
| 1242 | /* Get the query string from shared memory */ |
| 1243 | queryString = shm_toc_lookup(toc, PARALLEL_KEY_QUERY_TEXT, false); |
| 1244 | |
| 1245 | /* Reconstruct leader-supplied PlannedStmt. */ |
| 1246 | pstmtspace = shm_toc_lookup(toc, PARALLEL_KEY_PLANNEDSTMT, false); |
| 1247 | pstmt = (PlannedStmt *) stringToNode(pstmtspace); |
| 1248 | |
| 1249 | /* Reconstruct ParamListInfo. */ |
| 1250 | paramspace = shm_toc_lookup(toc, PARALLEL_KEY_PARAMLISTINFO, false); |
| 1251 | paramLI = RestoreParamList(¶mspace); |
| 1252 | |
| 1253 | /* Create a QueryDesc for the query. */ |
| 1254 | return CreateQueryDesc(pstmt, |
| 1255 | queryString, |
| 1256 | GetActiveSnapshot(), InvalidSnapshot, |
| 1257 | receiver, paramLI, NULL, instrument_options); |
| 1258 | } |
| 1259 | |
| 1260 | /* |
| 1261 | * Copy instrumentation information from this node and its descendants into |
no test coverage detected