forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4989ce7
committed
MERGE ... DO NOTHING: require SELECT privileges
Verify that a user running MERGE with a DO NOTHING clause hasprivileges to read the table, even if no columns are referenced. Suchprivileges were already required if the ON clause or any of the WHENconditions referenced any column at all, so there's no functional changein practice.This change fixes an assertion failure in the case where no column isreferenced by the command and the WHEN clauses are all DO NOTHING.Backpatch to 15, where MERGE was introduced.Reported-by: Alena Rybakina <a.rybakina@postgrespro.ru>Reported-by: Alexander Lakhin <exclusion@gmail.com>Discussion:https://postgr.es/m/4d65a385-7efa-4436-a825-0869f89d9d92@postgrespro.ru1 parented345c2 commit4989ce7
File tree
3 files changed
+27
-1
lines changed- src
- backend/parser
- test/regress
- expected
- sql
3 files changed
+27
-1
lines changedLines changed: 6 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
133 | 133 |
| |
134 | 134 |
| |
135 | 135 |
| |
136 |
| - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
137 | 141 |
| |
138 | 142 |
| |
139 | 143 |
| |
| |||
147 | 151 |
| |
148 | 152 |
| |
149 | 153 |
| |
| 154 | + | |
150 | 155 |
| |
151 | 156 |
| |
152 | 157 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| 6 | + | |
6 | 7 |
| |
7 | 8 |
| |
8 | 9 |
| |
| |||
159 | 160 |
| |
160 | 161 |
| |
161 | 162 |
| |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
162 | 171 |
| |
163 | 172 |
| |
164 | 173 |
| |
| |||
2248 | 2257 |
| |
2249 | 2258 |
| |
2250 | 2259 |
| |
| 2260 | + |
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
| 7 | + | |
| 8 | + | |
7 | 9 |
| |
8 | 10 |
| |
9 | 11 |
| |
| |||
118 | 120 |
| |
119 | 121 |
| |
120 | 122 |
| |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
121 | 131 |
| |
122 | 132 |
| |
123 | 133 |
| |
| |||
1471 | 1481 |
| |
1472 | 1482 |
| |
1473 | 1483 |
| |
| 1484 | + |
0 commit comments
Comments
(0)