forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1103033
committed
Reject SELECT ... GROUP BY GROUPING SETS (()) FOR UPDATE.
This case should be disallowed, just as FOR UPDATE with a plainGROUP BY is disallowed; FOR UPDATE only makes sense when each rowof the query result can be identified with a single table row.However, we missed teaching CheckSelectLocking() to checkgroupingSets as well as groupClause, so that it would allowdegenerate grouping sets. That resulted in a bad plan anda null-pointer dereference in the executor.Looking around for other instances of the same bug, the only oneI found was in examine_simple_variable(). That'd just lead tosilly estimates, but it should be fixed too.Per private report from Yaoguang Chen.Back-patch to all supported branches.1 parenteb89cb4 commit1103033
File tree
4 files changed
+12
-2
lines changed- src
- backend
- parser
- utils/adt
- test/regress
- expected
- sql
4 files changed
+12
-2
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3019 | 3019 |
| |
3020 | 3020 |
| |
3021 | 3021 |
| |
3022 |
| - | |
| 3022 | + | |
3023 | 3023 |
| |
3024 | 3024 |
| |
3025 | 3025 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5497 | 5497 |
| |
5498 | 5498 |
| |
5499 | 5499 |
| |
5500 |
| - | |
| 5500 | + | |
| 5501 | + | |
5501 | 5502 |
| |
5502 | 5503 |
| |
5503 | 5504 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
50 | 50 |
| |
51 | 51 |
| |
52 | 52 |
| |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
53 | 58 |
| |
54 | 59 |
| |
55 | 60 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 |
| |
41 | 45 |
| |
42 | 46 |
| |
|
0 commit comments
Comments
(0)