pgsql: Fix UtilityContainsQuery() to handle CREATE TABLE AS EXECUTE cor

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix UtilityContainsQuery() to handle CREATE TABLE AS EXECUTE cor
Date: 2012-10-19 22:34:07
Message-ID: E1TPL8p-0004UO-JY@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix UtilityContainsQuery() to handle CREATE TABLE AS EXECUTE correctly.

The code seems to have been written to handle the pre-parse-analysis
representation, where an ExecuteStmt would appear directly under
CreateTableAsStmt. But in reality the function is only run on
already-parse-analyzed statements, so there will be a Query node in
between. We'd not noticed the bug because the function is generally
not used at all except in extended query protocol.

Per report from Robert Haas and Rushabh Lathia.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/5d1abe64e62f2bb3c1a8a4181974f0b17b8bc21d

Modified Files
--------------
src/backend/tcop/utility.c | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2012-10-20 16:44:25 pgsql: Prevent overflow in pgbench's percent-done display.
Previous Message Tom Lane 2012-10-19 19:25:15 pgsql: Fix hash_search to avoid corruption of the hash table on out-of-