forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita316a3b
committed
Correctly set userid of subquery relations' child rels
The RelOptInfo->userid field (the user ID to check permissions as) of an"otherrel" relation was being copied from its parent relation, which iscorrect in most cases but wrong when the parent is a subquery. In thatcase, using the value from the RTEPermissionInfo of the child itself isthe appropriate thing to do.Coming up with a test case where user-visible behavior changes proveshard enough, so we don't add one here.Bug introduced bya61b1f7, discovered by Amit while reviewingnearby code.Author: Amit Langote <amitlangote09@gmail.com>Discussion:https://postgr.es/m/CA+HiwqE0WY_AhLnGtTsY7eYebG212XWbM-D8gr2A_ToOHyCywQ@mail.gmail.com1 parent94cad7a commita316a3b
1 file changed
+14
-4
lines changedLines changed: 14 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
233 | 233 |
| |
234 | 234 |
| |
235 | 235 |
| |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
236 | 240 |
| |
237 |
| - | |
238 |
| - | |
239 |
| - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
240 | 248 |
| |
241 |
| - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
242 | 252 |
| |
243 | 253 |
| |
244 | 254 |
| |
|
0 commit comments
Comments
(0)