mirror of
https://github.com/postgres/postgres.git
synced 2025-07-18 17:42:25 +03:00
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.
This commit is contained in:
@ -2037,12 +2037,12 @@ _outSelectStmt(StringInfo str, const SelectStmt *node)
|
||||
WRITE_NODE_FIELD(groupClause);
|
||||
WRITE_NODE_FIELD(havingClause);
|
||||
WRITE_NODE_FIELD(windowClause);
|
||||
WRITE_NODE_FIELD(withClause);
|
||||
WRITE_NODE_FIELD(valuesLists);
|
||||
WRITE_NODE_FIELD(sortClause);
|
||||
WRITE_NODE_FIELD(limitOffset);
|
||||
WRITE_NODE_FIELD(limitCount);
|
||||
WRITE_NODE_FIELD(lockingClause);
|
||||
WRITE_NODE_FIELD(withClause);
|
||||
WRITE_ENUM_FIELD(op, SetOperation);
|
||||
WRITE_BOOL_FIELD(all);
|
||||
WRITE_NODE_FIELD(larg);
|
||||
|
Reference in New Issue
Block a user