aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_clause.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-09-09 03:32:52 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-09-09 03:32:52 +0000
commit255f66efa9b648500a4f06b839d0256987406f0f (patch)
tree985cab75c2b9cd5e911e7b5ea56dd1558b35aa40 /src/backend/parser/parse_clause.c
parentd69a419e682c2d39c2355105a7e5e2b90357c8f0 (diff)
downloadpostgresql-255f66efa9b648500a4f06b839d0256987406f0f.tar.gz
postgresql-255f66efa9b648500a4f06b839d0256987406f0f.zip
Fix bug with WITH RECURSIVE immediately inside WITH RECURSIVE. 99% of the
code was already okay with this, but the hack that obtained the output column types of a recursive union in advance of doing real parse analysis of the recursive union forgot to handle the case where there was an inner WITH clause available to the non-recursive term. Best fix seems to be to refactor so that we don't need the "throwaway" parse analysis step at all. Instead, teach the transformSetOperationStmt code to set up the CTE's output column information after it's processed the non-recursive term normally. Per report from David Fetter.
Diffstat (limited to 'src/backend/parser/parse_clause.c')
-rw-r--r--src/backend/parser/parse_clause.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index a63a280a8cb..c3bdf33a998 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_clause.c,v 1.191 2009/08/27 20:08:02 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_clause.c,v 1.192 2009/09/09 03:32:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -479,7 +479,7 @@ transformRangeSubselect(ParseState *pstate, RangeSubselect *r)
/*
* Analyze and transform the subquery.
*/
- query = parse_sub_analyze(r->subquery, pstate);
+ query = parse_sub_analyze(r->subquery, pstate, NULL);
/*
* Check that we got something reasonable. Many of these conditions are