Skip to content

Commit dbb2a93

Browse files
committed
Ensure that ExecPrepareExprList's result is all in one memory context.
Noted by Amit Langote. Discussion: https://postgr.es/m/aad31672-4983-d95d-d24e-6b42fee9b985@lab.ntt.co.jp
1 parent 0c73285 commit dbb2a93

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/backend/executor/execExpr.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,15 +511,21 @@ List *
511511
ExecPrepareExprList(List *nodes, EState *estate)
512512
{
513513
List *result = NIL;
514+
MemoryContext oldcontext;
514515
ListCell *lc;
515516

517+
/* Ensure that the list cell nodes are in the right context too */
518+
oldcontext = MemoryContextSwitchTo(estate->es_query_cxt);
519+
516520
foreach(lc, nodes)
517521
{
518522
Expr *e = (Expr *) lfirst(lc);
519523

520524
result = lappend(result, ExecPrepareExpr(e, estate));
521525
}
522526

527+
MemoryContextSwitchTo(oldcontext);
528+
523529
return result;
524530
}
525531

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy