Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit110ba08

Browse files
committed
Fix binary cursors broken by MOVE implementation.
(Thanks to Bruce for finding what caused problem).
1 parentf15eeff commit110ba08

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

‎src/backend/commands/command.c

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.19 1997/09/29 05:56:10 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.20 1997/10/27 08:55:16 vadim Exp $
1111
*
1212
* NOTES
1313
* The PortalExecutorHeapMemory crap needs to be eliminated
@@ -97,10 +97,10 @@ PerformPortalFetch(char *name,
9797
char*tag,
9898
CommandDestdest)
9999
{
100-
Portalportal;
101-
intfeature;
102-
QueryDescqueryDesc;
103-
MemoryContextcontext;
100+
Portalportal;
101+
intfeature;
102+
QueryDesc*queryDesc;
103+
MemoryContextcontext;
104104

105105
/* ----------------
106106
*sanity checks
@@ -147,11 +147,19 @@ PerformPortalFetch(char *name,
147147
*tell the destination to prepare to recieve some tuples
148148
* ----------------
149149
*/
150-
memcpy (&queryDesc,PortalGetQueryDesc(portal),sizeof (queryDesc));
151-
queryDesc.dest=dest;
150+
queryDesc=PortalGetQueryDesc(portal);
151+
152+
if (dest==None )/* MOVE */
153+
{
154+
QueryDesc*qdesc= (QueryDesc*)palloc (sizeof (QueryDesc));
155+
156+
memcpy (qdesc,queryDesc,sizeof (QueryDesc));
157+
qdesc->dest=dest;
158+
queryDesc=qdesc;
159+
}
152160

153161
BeginCommand(name,
154-
queryDesc.operation,
162+
queryDesc->operation,
155163
portal->attinfo,/* QueryDescGetTypeInfo(queryDesc),
156164
* */
157165
false,/* portal fetches don't end up in
@@ -168,8 +176,11 @@ PerformPortalFetch(char *name,
168176
PortalExecutorHeapMemory= (MemoryContext)
169177
PortalGetHeapMemory(portal);
170178

171-
ExecutorRun(&queryDesc,PortalGetState(portal),feature,count);
179+
ExecutorRun(queryDesc,PortalGetState(portal),feature,count);
172180

181+
if (dest==None )/* MOVE */
182+
pfree (queryDesc);
183+
173184
/* ----------------
174185
* Note: the "end-of-command" tag is returned by higher-level
175186
* utility code

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp