mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Update 3.0 protocol support to match recent agreements about how to
handle multiple 'formats' for data I/O. Restructure CommandDest and DestReceiver stuff one more time (it's finally starting to look a bit clean though). Code now matches latest 3.0 protocol document as far as message formats go --- but there is no support for binary I/O yet.
This commit is contained in:
@ -26,7 +26,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.208 2003/05/06 20:26:26 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.209 2003/05/08 18:16:36 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -217,10 +217,7 @@ ExecutorRun(QueryDesc *queryDesc,
|
||||
estate->es_processed = 0;
|
||||
estate->es_lastoid = InvalidOid;
|
||||
|
||||
(*dest->startup) (dest, operation,
|
||||
queryDesc->portalName,
|
||||
queryDesc->tupDesc,
|
||||
queryDesc->planstate->plan->targetlist);
|
||||
(*dest->startup) (dest, operation, queryDesc->tupDesc);
|
||||
|
||||
/*
|
||||
* run plan
|
||||
|
@ -15,7 +15,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.65 2003/05/06 20:26:27 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.66 2003/05/08 18:16:36 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -765,8 +765,7 @@ begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc)
|
||||
tstate->metadata = TupleDescGetAttInMetadata(tupdesc);
|
||||
tstate->dest = dest;
|
||||
|
||||
(*tstate->dest->startup) (tstate->dest, (int) CMD_SELECT,
|
||||
NULL, tupdesc, NIL);
|
||||
(*tstate->dest->startup) (tstate->dest, (int) CMD_SELECT, tupdesc);
|
||||
|
||||
return tstate;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.64 2003/05/06 20:26:27 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.65 2003/05/08 18:16:36 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -245,7 +245,7 @@ postquel_start(execution_state *es, SQLFunctionCachePtr fcache)
|
||||
{
|
||||
Assert(es->qd == NULL);
|
||||
es->qd = CreateQueryDesc(es->query, es->plan,
|
||||
None_Receiver, NULL,
|
||||
None_Receiver,
|
||||
fcache->paramLI, false);
|
||||
|
||||
/* Utility commands don't need Executor. */
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.96 2003/05/06 20:26:27 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.97 2003/05/08 18:16:36 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -841,7 +841,8 @@ SPI_cursor_find(const char *name)
|
||||
void
|
||||
SPI_cursor_fetch(Portal portal, bool forward, int count)
|
||||
{
|
||||
_SPI_cursor_operation(portal, forward, count, CreateDestReceiver(SPI));
|
||||
_SPI_cursor_operation(portal, forward, count,
|
||||
CreateDestReceiver(SPI, NULL));
|
||||
/* we know that the SPI receiver doesn't need a destroy call */
|
||||
}
|
||||
|
||||
@ -880,8 +881,7 @@ SPI_cursor_close(Portal portal)
|
||||
* of current SPI procedure
|
||||
*/
|
||||
void
|
||||
spi_dest_startup(DestReceiver *self, int operation,
|
||||
const char *portalName, TupleDesc typeinfo, List *targetlist)
|
||||
spi_dest_startup(DestReceiver *self, int operation, TupleDesc typeinfo)
|
||||
{
|
||||
SPITupleTable *tuptable;
|
||||
MemoryContext oldcxt;
|
||||
@ -1035,7 +1035,7 @@ _SPI_execute(const char *src, int tcount, _SPI_plan *plan)
|
||||
planTree = pg_plan_query(queryTree);
|
||||
plan_list = lappend(plan_list, planTree);
|
||||
|
||||
dest = CreateDestReceiver(queryTree->canSetTag ? SPI : None);
|
||||
dest = CreateDestReceiver(queryTree->canSetTag ? SPI : None, NULL);
|
||||
if (queryTree->commandType == CMD_UTILITY)
|
||||
{
|
||||
if (IsA(queryTree->utilityStmt, CopyStmt))
|
||||
@ -1061,7 +1061,7 @@ _SPI_execute(const char *src, int tcount, _SPI_plan *plan)
|
||||
else if (plan == NULL)
|
||||
{
|
||||
qdesc = CreateQueryDesc(queryTree, planTree, dest,
|
||||
NULL, NULL, false);
|
||||
NULL, false);
|
||||
res = _SPI_pquery(qdesc, true,
|
||||
queryTree->canSetTag ? tcount : 0);
|
||||
if (res < 0)
|
||||
@ -1071,7 +1071,7 @@ _SPI_execute(const char *src, int tcount, _SPI_plan *plan)
|
||||
else
|
||||
{
|
||||
qdesc = CreateQueryDesc(queryTree, planTree, dest,
|
||||
NULL, NULL, false);
|
||||
NULL, false);
|
||||
res = _SPI_pquery(qdesc, false, 0);
|
||||
if (res < 0)
|
||||
return res;
|
||||
@ -1150,7 +1150,7 @@ _SPI_execute_plan(_SPI_plan *plan, Datum *Values, const char *Nulls,
|
||||
planTree = lfirst(plan_list);
|
||||
plan_list = lnext(plan_list);
|
||||
|
||||
dest = CreateDestReceiver(queryTree->canSetTag ? SPI : None);
|
||||
dest = CreateDestReceiver(queryTree->canSetTag ? SPI : None, NULL);
|
||||
if (queryTree->commandType == CMD_UTILITY)
|
||||
{
|
||||
ProcessUtility(queryTree->utilityStmt, dest, NULL);
|
||||
@ -1160,7 +1160,7 @@ _SPI_execute_plan(_SPI_plan *plan, Datum *Values, const char *Nulls,
|
||||
else
|
||||
{
|
||||
qdesc = CreateQueryDesc(queryTree, planTree, dest,
|
||||
NULL, paramLI, false);
|
||||
paramLI, false);
|
||||
res = _SPI_pquery(qdesc, true,
|
||||
queryTree->canSetTag ? tcount : 0);
|
||||
if (res < 0)
|
||||
|
@ -9,7 +9,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/tstoreReceiver.c,v 1.5 2003/05/06 20:26:27 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/tstoreReceiver.c,v 1.6 2003/05/08 18:16:36 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -31,9 +31,7 @@ typedef struct
|
||||
* Prepare to receive tuples from executor.
|
||||
*/
|
||||
static void
|
||||
tstoreStartupReceiver(DestReceiver *self, int operation,
|
||||
const char *portalname,
|
||||
TupleDesc typeinfo, List *targetlist)
|
||||
tstoreStartupReceiver(DestReceiver *self, int operation, TupleDesc typeinfo)
|
||||
{
|
||||
/* do nothing */
|
||||
}
|
||||
|
Reference in New Issue
Block a user