diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2021-06-01 11:12:56 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2021-06-01 11:12:56 -0400 |
commit | 3eca18522e1908f7a61ab2545bb9238fce4d1ba7 (patch) | |
tree | c0772a76a884b8eb84e7087c8a3092705f751c14 /src/backend/parser/parse_coerce.c | |
parent | 34a65fc63e0870c7e0118e76f42b9f0996ab4195 (diff) |
Reject SELECT ... GROUP BY GROUPING SETS (()) FOR UPDATE.
This case should be disallowed, just as FOR UPDATE with a plain
GROUP BY is disallowed; FOR UPDATE only makes sense when each row
of the query result can be identified with a single table row.
However, we missed teaching CheckSelectLocking() to check
groupingSets as well as groupClause, so that it would allow
degenerate grouping sets. That resulted in a bad plan and
a null-pointer dereference in the executor.
Looking around for other instances of the same bug, the only one
I found was in examine_simple_variable(). That'd just lead to
silly estimates, but it should be fixed too.
Per private report from Yaoguang Chen.
Back-patch to all supported branches.
Diffstat (limited to 'src/backend/parser/parse_coerce.c')
0 files changed, 0 insertions, 0 deletions