summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2003-04-03 22:35:48 +0000
committerTom Lane2003-04-03 22:35:48 +0000
commitf1fb9e009797aaef7619d9191eaa3ff6685f1164 (patch)
tree5b24056503501e445c0eeab6af940ceba9ccb84c
parent14e6823c7c794ee28ca79d5446757a5022b25ad4 (diff)
Prevent EXPLAIN (without ANALYZE) SELECT ... INTO from creating an INTO
table. Needed due to recent change that makes us call ExecutorStart even when not planning to carry out the query.
-rw-r--r--src/backend/commands/explain.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index 11425620e6b..09d422f85c0 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994-5, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.104 2003/03/10 03:53:49 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.105 2003/04/03 22:35:48 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -193,6 +193,14 @@ ExplainOnePlan(QueryDesc *queryDesc, ExplainStmt *stmt,
ExplainState *es;
StringInfo str;
+ /*
+ * If we are not going to execute, suppress any SELECT INTO marker.
+ * Without this, ExecutorStart will create the INTO target table,
+ * which we don't want.
+ */
+ if (!stmt->analyze)
+ queryDesc->parsetree->into = NULL;
+
gettimeofday(&starttime, NULL);
/* call ExecutorStart to prepare the plan for execution */