Fix binary cursors broken by MOVE implementation.
(Thanks to Bruce for finding what caused problem).
This commit is contained in:
parent
f15eeff1bd
commit
110ba08a12
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.19 1997/09/29 05:56:10 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.20 1997/10/27 08:55:16 vadim Exp $
|
||||
*
|
||||
* NOTES
|
||||
* The PortalExecutorHeapMemory crap needs to be eliminated
|
||||
@ -97,10 +97,10 @@ PerformPortalFetch(char *name,
|
||||
char *tag,
|
||||
CommandDest dest)
|
||||
{
|
||||
Portal portal;
|
||||
int feature;
|
||||
QueryDesc queryDesc;
|
||||
MemoryContext context;
|
||||
Portal portal;
|
||||
int feature;
|
||||
QueryDesc *queryDesc;
|
||||
MemoryContext context;
|
||||
|
||||
/* ----------------
|
||||
* sanity checks
|
||||
@ -147,11 +147,19 @@ PerformPortalFetch(char *name,
|
||||
* tell the destination to prepare to recieve some tuples
|
||||
* ----------------
|
||||
*/
|
||||
memcpy (&queryDesc, PortalGetQueryDesc(portal), sizeof (queryDesc));
|
||||
queryDesc.dest = dest;
|
||||
queryDesc = PortalGetQueryDesc(portal);
|
||||
|
||||
if ( dest == None ) /* MOVE */
|
||||
{
|
||||
QueryDesc *qdesc = (QueryDesc *) palloc (sizeof (QueryDesc));
|
||||
|
||||
memcpy (qdesc, queryDesc, sizeof (QueryDesc));
|
||||
qdesc->dest = dest;
|
||||
queryDesc = qdesc;
|
||||
}
|
||||
|
||||
BeginCommand(name,
|
||||
queryDesc.operation,
|
||||
queryDesc->operation,
|
||||
portal->attinfo, /* QueryDescGetTypeInfo(queryDesc),
|
||||
* */
|
||||
false, /* portal fetches don't end up in
|
||||
@ -168,8 +176,11 @@ PerformPortalFetch(char *name,
|
||||
PortalExecutorHeapMemory = (MemoryContext)
|
||||
PortalGetHeapMemory(portal);
|
||||
|
||||
ExecutorRun(&queryDesc, PortalGetState(portal), feature, count);
|
||||
ExecutorRun(queryDesc, PortalGetState(portal), feature, count);
|
||||
|
||||
if ( dest == None ) /* MOVE */
|
||||
pfree (queryDesc);
|
||||
|
||||
/* ----------------
|
||||
* Note: the "end-of-command" tag is returned by higher-level
|
||||
* utility code
|
||||
|
Loading…
x
Reference in New Issue
Block a user