summaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
authorNathan Bossart2023-11-15 19:42:30 +0000
committerNathan Bossart2023-11-15 19:42:30 +0000
commit6a72c42fd5af7ada49584694f543eb06dddb4a87 (patch)
treec2f566a161756b8aca8a58d58d4b0a0b6ee08da7 /src/backend/executor
parent83267b15bf0dffa6e1096608bda95b8488048bb9 (diff)
Retire MemoryContextResetAndDeleteChildren() macro.
As of commit eaa5808e8e, MemoryContextResetAndDeleteChildren() is just a backwards compatibility macro for MemoryContextReset(). Now that some time has passed, this macro seems more likely to create confusion. This commit removes the macro and replaces all remaining uses with calls to MemoryContextReset(). Any third-party code that use this macro will need to be adjusted to call MemoryContextReset() instead. Since the two have behaved the same way since v9.5, such adjustments won't produce any behavior changes for all currently-supported versions of PostgreSQL. Reviewed-by: Amul Sul, Tom Lane, Alvaro Herrera, Dagfinn Ilmari Mannsåker Discussion: https://postgr.es/m/20231113185950.GA1668018%40nathanxps13
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/nodeRecursiveunion.c2
-rw-r--r--src/backend/executor/nodeSetOp.c2
-rw-r--r--src/backend/executor/nodeWindowAgg.c10
-rw-r--r--src/backend/executor/spi.c4
4 files changed, 9 insertions, 9 deletions
diff --git a/src/backend/executor/nodeRecursiveunion.c b/src/backend/executor/nodeRecursiveunion.c
index e7810039341..3207643156e 100644
--- a/src/backend/executor/nodeRecursiveunion.c
+++ b/src/backend/executor/nodeRecursiveunion.c
@@ -317,7 +317,7 @@ ExecReScanRecursiveUnion(RecursiveUnionState *node)
/* Release any hashtable storage */
if (node->tableContext)
- MemoryContextResetAndDeleteChildren(node->tableContext);
+ MemoryContextReset(node->tableContext);
/* Empty hashtable if needed */
if (plan->numCols > 0)
diff --git a/src/backend/executor/nodeSetOp.c b/src/backend/executor/nodeSetOp.c
index 98c1b84d436..5a84969cf81 100644
--- a/src/backend/executor/nodeSetOp.c
+++ b/src/backend/executor/nodeSetOp.c
@@ -631,7 +631,7 @@ ExecReScanSetOp(SetOpState *node)
/* Release any hashtable storage */
if (node->tableContext)
- MemoryContextResetAndDeleteChildren(node->tableContext);
+ MemoryContextReset(node->tableContext);
/* And rebuild empty hashtable if needed */
if (((SetOp *) node->ps.plan)->strategy == SETOP_HASHED)
diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c
index 77724a6daaf..3258305f57f 100644
--- a/src/backend/executor/nodeWindowAgg.c
+++ b/src/backend/executor/nodeWindowAgg.c
@@ -216,7 +216,7 @@ initialize_windowaggregate(WindowAggState *winstate,
* it, so we must leave it to the caller to reset at an appropriate time.
*/
if (peraggstate->aggcontext != winstate->aggcontext)
- MemoryContextResetAndDeleteChildren(peraggstate->aggcontext);
+ MemoryContextReset(peraggstate->aggcontext);
if (peraggstate->initValueIsNull)
peraggstate->transValue = peraggstate->initValue;
@@ -875,7 +875,7 @@ eval_windowaggregates(WindowAggState *winstate)
* result for it, else we'll leak memory.
*/
if (numaggs_restart > 0)
- MemoryContextResetAndDeleteChildren(winstate->aggcontext);
+ MemoryContextReset(winstate->aggcontext);
for (i = 0; i < numaggs; i++)
{
peraggstate = &winstate->peragg[i];
@@ -1351,12 +1351,12 @@ release_partition(WindowAggState *winstate)
* any aggregate temp data). We don't rely on retail pfree because some
* aggregates might have allocated data we don't have direct pointers to.
*/
- MemoryContextResetAndDeleteChildren(winstate->partcontext);
- MemoryContextResetAndDeleteChildren(winstate->aggcontext);
+ MemoryContextReset(winstate->partcontext);
+ MemoryContextReset(winstate->aggcontext);
for (i = 0; i < winstate->numaggs; i++)
{
if (winstate->peragg[i].aggcontext != winstate->aggcontext)
- MemoryContextResetAndDeleteChildren(winstate->peragg[i].aggcontext);
+ MemoryContextReset(winstate->peragg[i].aggcontext);
}
if (winstate->buffer)
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c
index 33975687b38..0e46c59d25d 100644
--- a/src/backend/executor/spi.c
+++ b/src/backend/executor/spi.c
@@ -547,7 +547,7 @@ AtEOSubXact_SPI(bool isCommit, SubTransactionId mySubid)
if (_SPI_current->execSubid >= mySubid)
{
_SPI_current->execSubid = InvalidSubTransactionId;
- MemoryContextResetAndDeleteChildren(_SPI_current->execCxt);
+ MemoryContextReset(_SPI_current->execCxt);
}
/* throw away any tuple tables created within current subxact */
@@ -3083,7 +3083,7 @@ _SPI_end_call(bool use_exec)
/* mark Executor context no longer in use */
_SPI_current->execSubid = InvalidSubTransactionId;
/* and free Executor memory */
- MemoryContextResetAndDeleteChildren(_SPI_current->execCxt);
+ MemoryContextReset(_SPI_current->execCxt);
}
return 0;