summaryrefslogtreecommitdiff
path: root/src/backend/parser/analyze.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/parser/analyze.c')
-rw-r--r--src/backend/parser/analyze.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index 413513cfa6c..f473ded48f9 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.213 2002/01/03 23:21:31 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.213.2.1 2002/02/26 23:48:43 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -121,6 +121,7 @@ parse_analyze(Node *parseTree, ParseState *parentParseState)
List *result = NIL;
ParseState *pstate = make_parsestate(parentParseState);
Query *query;
+ List *listscan;
extras_before = extras_after = NIL;
@@ -145,6 +146,18 @@ parse_analyze(Node *parseTree, ParseState *parentParseState)
extras_after = lnext(extras_after);
}
+ /*
+ * Make sure that only the original query is marked original.
+ * We have to do this explicitly since recursive calls of parse_analyze
+ * will have set originalQuery in some of the added-on queries.
+ */
+ foreach(listscan, result)
+ {
+ Query *q = lfirst(listscan);
+
+ q->originalQuery = (q == query);
+ }
+
pfree(pstate);
return result;