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:32:52
Message-ID: 20090909033252.A3054753FB7@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.

Modified Files:
--------------
    pgsql/src/backend/parser:
        analyze.c (r1.390 -> r1.391)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/analyze.c?r1=1.390&r2=1.391)
        parse_clause.c (r1.191 -> r1.192)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_clause.c?r1=1.191&r2=1.192)
        parse_cte.c (r2.6 -> r2.7)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_cte.c?r1=2.6&r2=2.7)
        parse_expr.c (r1.242 -> r1.243)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_expr.c?r1=1.242&r2=1.243)
    pgsql/src/include/parser:
        analyze.h (r1.40 -> r1.41)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/parser/analyze.h?r1=1.40&r2=1.41)
        parse_cte.h (r1.2 -> r1.3)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/parser/parse_cte.h?r1=1.2&r2=1.3)
        parse_node.h (r1.62 -> r1.63)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/parser/parse_node.h?r1=1.62&r2=1.63)
    pgsql/src/test/regress/expected:
        with.out (r1.11 -> r1.12)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/with.out?r1=1.11&r2=1.12)
    pgsql/src/test/regress/sql:
        with.sql (r1.10 -> r1.11)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/with.sql?r1=1.10&r2=1.11)

pgsql-committers by date

Next:From: Tom LaneDate: 2009-09-09 03:33:01
Subject: pgsql: Fix bug with WITH RECURSIVE immediately inside WITH RECURSIVE.
Previous:From: User KasaharaDate: 2009-09-09 01:49:04
Subject: pgstatsinfo - pg_statsinfo: - Add dblink_disconnect() to log cleanup

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