aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_utilcmd.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-06-27 23:18:37 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2012-06-27 23:18:37 -0400
commitc8967e38a65e4afac7027d570136ca6dac5cacc1 (patch)
tree0a47fd410f1c1d3838cae3296a00fd03d9503630 /src/backend/parser/parse_utilcmd.c
parent5ff9ad664745b5cb2c6562ff2691b9418cd59c88 (diff)
downloadpostgresql-c8967e38a65e4afac7027d570136ca6dac5cacc1.tar.gz
postgresql-c8967e38a65e4afac7027d570136ca6dac5cacc1.zip
Make UtilityContainsQuery recurse until it finds a non-utility Query.
The callers of UtilityContainsQuery want it to return a non-utility Query if it returns anything at all. However, since we made CREATE TABLE AS/SELECT INTO into a utility command instead of a variant of SELECT, a command like "EXPLAIN SELECT INTO" results in two nested utility statements. So what we need UtilityContainsQuery to do is drill down to the bottom non-utility Query. I had thought of this possibility in setrefs.c, and fixed it there by looping around the UtilityContainsQuery call; but overlooked that the call sites in plancache.c have a similar issue. In those cases it's notationally inconvenient to provide an external loop, so let's redefine UtilityContainsQuery as recursing down to a non-utility Query instead. Noted by Rushabh Lathia. This is a somewhat cleaned-up version of his proposed patch.
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
0 files changed, 0 insertions, 0 deletions