0001-Use-per-tuple-context-in-ExecGetAllUpdatedCols.patch
text/x-patch
Filename: 0001-Use-per-tuple-context-in-ExecGetAllUpdatedCols.patch
Type: text/x-patch
Part: 0
Patch
Format: format-patch
Series: patch 0001
Subject: Use per-tuple context in ExecGetAllUpdatedCols
| File | + | − |
|---|---|---|
| src/backend/executor/execUtils.c | 10 | 2 |
From 9a6eccebaea969eb5d2e15de99aaabb40b02499c Mon Sep 17 00:00:00 2001
From: Tomas Vondra <tomas.vondra@postgresql.org>
Date: Tue, 23 May 2023 17:45:47 +0200
Subject: [PATCH] Use per-tuple context in ExecGetAllUpdatedCols
---
src/backend/executor/execUtils.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c
index 25aba9a243a..37f2fa173f6 100644
--- a/src/backend/executor/execUtils.c
+++ b/src/backend/executor/execUtils.c
@@ -1349,8 +1349,16 @@ ExecGetExtraUpdatedCols(ResultRelInfo *relinfo, EState *estate)
Bitmapset *
ExecGetAllUpdatedCols(ResultRelInfo *relinfo, EState *estate)
{
- return bms_union(ExecGetUpdatedCols(relinfo, estate),
- ExecGetExtraUpdatedCols(relinfo, estate));
+ Bitmapset *ret;
+ MemoryContext oldcxt
+ = MemoryContextSwitchTo(GetPerTupleMemoryContext(estate));
+
+ ret = bms_union(ExecGetUpdatedCols(relinfo, estate),
+ ExecGetExtraUpdatedCols(relinfo, estate));
+
+ MemoryContextSwitchTo(oldcxt);
+
+ return ret;
}
/*
--
2.40.1