Content-Length: 278593 | pFad | http://github.com/postgrespro/postgres/commit/dbb2a931478a397a2b655eb77e8be8c1ca136f63

77 Ensure that ExecPrepareExprList's result is all in one memory context. · postgrespro/postgres@dbb2a93 · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/dbb2a931478a397a2b655eb77e8be8c1ca136f63

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy