summaryrefslogtreecommitdiff
path: root/src/backend/commands/prepare.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/prepare.c')
-rw-r--r--src/backend/commands/prepare.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/backend/commands/prepare.c b/src/backend/commands/prepare.c
index 3f8beac53c1..c317494f6fa 100644
--- a/src/backend/commands/prepare.c
+++ b/src/backend/commands/prepare.c
@@ -10,7 +10,7 @@
* Copyright (c) 2002-2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/prepare.c,v 1.15 2003/05/05 00:44:55 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/prepare.c,v 1.16 2003/05/06 20:26:26 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -102,7 +102,7 @@ PrepareQuery(PrepareStmt *stmt)
* Implements the 'EXECUTE' utility statement.
*/
void
-ExecuteQuery(ExecuteStmt *stmt, CommandDest outputDest)
+ExecuteQuery(ExecuteStmt *stmt, DestReceiver *dest)
{
PreparedStatement *entry;
char *query_string;
@@ -180,7 +180,7 @@ ExecuteQuery(ExecuteStmt *stmt, CommandDest outputDest)
*/
PortalStart(portal, paramLI);
- (void) PortalRun(portal, FETCH_ALL, outputDest, outputDest, NULL);
+ (void) PortalRun(portal, FETCH_ALL, dest, dest, NULL);
PortalDrop(portal, false);
@@ -488,19 +488,21 @@ ExplainExecuteQuery(ExplainStmt *stmt, TupOutputState *tstate)
{
QueryDesc *qdesc;
- /* Create a QueryDesc requesting no output */
- qdesc = CreateQueryDesc(query, plan, None, NULL,
- paramLI, stmt->analyze);
-
if (execstmt->into)
{
- if (qdesc->operation != CMD_SELECT)
+ if (query->commandType != CMD_SELECT)
elog(ERROR, "INTO clause specified for non-SELECT query");
+ /* Copy the query so we can modify it */
+ query = copyObject(query);
+
query->into = execstmt->into;
- qdesc->dest = None;
}
+ /* Create a QueryDesc requesting no output */
+ qdesc = CreateQueryDesc(query, plan, None_Receiver, NULL,
+ paramLI, stmt->analyze);
+
ExplainOnePlan(qdesc, stmt, tstate);
}