diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-07-31 17:56:21 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-07-31 17:56:21 -0400 |
commit | f6ce81f55a3c6932d5f88bc89374f404688f054e (patch) | |
tree | bc5fc3caa565d7c9c2f72eb8656246be3ef21c07 /src/include/nodes/parsenodes.h | |
parent | b76356ac22d8322e6074981b4d34ee19cd0dbc8a (diff) |
Fix WITH attached to a nested set operation (UNION/INTERSECT/EXCEPT).
Parse analysis neglected to cover the case of a WITH clause attached to an
intermediate-level set operation; it only handled WITH at the top level
or WITH attached to a leaf-level SELECT. Per report from Adam Mackler.
In HEAD, I rearranged the order of SelectStmt's fields to put withClause
with the other fields that can appear on non-leaf SelectStmts. In back
branches, leave it alone to avoid a possible ABI break for third-party
code.
Back-patch to 8.4 where WITH support was added.
Diffstat (limited to 'src/include/nodes/parsenodes.h')
-rw-r--r-- | src/include/nodes/parsenodes.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 1f89cd51595..119e1ed2f6e 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -1016,7 +1016,6 @@ typedef struct SelectStmt List *groupClause; /* GROUP BY clauses */ Node *havingClause; /* HAVING conditional-expression */ List *windowClause; /* WINDOW window_name AS (...), ... */ - WithClause *withClause; /* WITH clause */ /* * In a "leaf" node representing a VALUES list, the above fields are all @@ -1036,6 +1035,7 @@ typedef struct SelectStmt Node *limitOffset; /* # of result tuples to skip */ Node *limitCount; /* # of result tuples to return */ List *lockingClause; /* FOR UPDATE (list of LockingClause's) */ + WithClause *withClause; /* WITH clause */ /* * These fields are used only in upper-level SelectStmts. |