aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_expr.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-09-09 03:33:01 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-09-09 03:33:01 +0000
commit9ed9ac5a38431cf328088657c4c82b63e6326aab (patch)
treef1e387d920e19b4d60d0ec607c137853c9dc99ef /src/backend/parser/parse_expr.c
parent3385dcc8c8b395230d8b9d450f1d4e77bc43243f (diff)
downloadpostgresql-9ed9ac5a38431cf328088657c4c82b63e6326aab.tar.gz
postgresql-9ed9ac5a38431cf328088657c4c82b63e6326aab.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_expr.c')
-rw-r--r--src/backend/parser/parse_expr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c
index 08e062d311e..45c0a0970b1 100644
--- a/src/backend/parser/parse_expr.c
+++ b/src/backend/parser/parse_expr.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_expr.c,v 1.241 2009/06/11 14:49:00 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_expr.c,v 1.241.2.1 2009/09/09 03:33:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1251,7 +1251,7 @@ transformSubLink(ParseState *pstate, SubLink *sublink)
return result;
pstate->p_hasSubLinks = true;
- qtree = parse_sub_analyze(sublink->subselect, pstate);
+ qtree = parse_sub_analyze(sublink->subselect, pstate, NULL);
/*
* Check that we got something reasonable. Many of these conditions are