Skip to content

Commit 04cb9a6

Browse files
committed
Paranoia about data structure lifetime ...
1 parent 6779c55 commit 04cb9a6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/tcop/pquery.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.48 2002/02/27 19:35:16 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.49 2002/02/27 19:52:41 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -158,7 +158,6 @@ ProcessQuery(Query *parsetree,
158158
if (parsetree->isPortal)
159159
{
160160
isRetrieveIntoPortal = true;
161-
intoName = parsetree->into;
162161
/* If binary portal, switch to alternate output format */
163162
if (dest == Remote && parsetree->isBinary)
164163
dest = RemoteInternal;
@@ -182,10 +181,12 @@ ProcessQuery(Query *parsetree,
182181
*/
183182
if (isRetrieveIntoPortal)
184183
{
184+
intoName = parsetree->into;
185185
portal = PreparePortal(intoName);
186186
oldContext = MemoryContextSwitchTo(PortalGetHeapMemory(portal));
187187
parsetree = copyObject(parsetree);
188188
plan = copyObject(plan);
189+
intoName = parsetree->into; /* use copied name in QueryDesc */
189190

190191
/*
191192
* We stay in portal's memory context for now, so that query desc,

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