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

Function ExecutorRewind

src/backend/executor/execMain.c:1405–1432  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecutorRewind * * This routine may be called on an open queryDesc to rewind it * to the start. * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

1403 * ----------------------------------------------------------------
1404 */
1405void
1406ExecutorRewind(QueryDesc *queryDesc)
1407{
1408 EState *estate;
1409 MemoryContext oldcontext;
1410
1411 /* sanity checks */
1412 Assert(queryDesc != NULL);
1413
1414 estate = queryDesc->estate;
1415
1416 Assert(estate != NULL);
1417
1418 /* It's probably not sensible to rescan updating queries */
1419 Assert(queryDesc->operation == CMD_SELECT);
1420
1421 /*
1422 * Switch into per-query memory context
1423 */
1424 oldcontext = MemoryContextSwitchTo(estate->es_query_cxt);
1425
1426 /*
1427 * rescan plan
1428 */
1429 ExecReScan(queryDesc->planstate);
1430
1431 MemoryContextSwitchTo(oldcontext);
1432}
1433
1434
1435/*

Callers 2

DoPortalRewindFunction · 0.85
PersistHoldablePortalFunction · 0.85

Calls 2

MemoryContextSwitchToFunction · 0.85
ExecReScanFunction · 0.85

Tested by

no test coverage detected