Skip site navigation (1) Skip section navigation (2)

pgsql: Fix bug with WITH RECURSIVE immediately inside WITH RECURSIVE.

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix bug with WITH RECURSIVE immediately inside WITH RECURSIVE.
Date: 2009-09-09 03:33:01
Message-ID: 20090909033301.7F7AF753FB7@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
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.

Tags:
----
REL8_4_STABLE

Modified Files:
--------------
    pgsql/src/backend/parser:
        analyze.c (r1.389.2.1 -> r1.389.2.2)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/analyze.c?r1=1.389.2.1&r2=1.389.2.2)
        parse_clause.c (r1.189.2.1 -> r1.189.2.2)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_clause.c?r1=1.189.2.1&r2=1.189.2.2)
        parse_cte.c (r2.6 -> r2.6.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_cte.c?r1=2.6&r2=2.6.2.1)
        parse_expr.c (r1.241 -> r1.241.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_expr.c?r1=1.241&r2=1.241.2.1)
    pgsql/src/include/parser:
        analyze.h (r1.40 -> r1.40.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/parser/analyze.h?r1=1.40&r2=1.40.2.1)
        parse_cte.h (r1.2 -> r1.2.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/parser/parse_cte.h?r1=1.2&r2=1.2.2.1)
        parse_node.h (r1.62 -> r1.62.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/parser/parse_node.h?r1=1.62&r2=1.62.2.1)
    pgsql/src/test/regress/expected:
        with.out (r1.10.2.1 -> r1.10.2.2)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/with.out?r1=1.10.2.1&r2=1.10.2.2)
    pgsql/src/test/regress/sql:
        with.sql (r1.9.2.1 -> r1.9.2.2)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/with.sql?r1=1.9.2.1&r2=1.9.2.2)

pgsql-committers by date

Next:From: Peter EisentrautDate: 2009-09-09 19:00:09
Subject: pgsql: Fix/improve bytea and boolean support in PL/Python Before,
Previous:From: Tom LaneDate: 2009-09-09 03:32:52
Subject: pgsql: Fix bug with WITH RECURSIVE immediately inside WITH RECURSIVE.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group