forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb4110bd
committed
Correctly update hasSubLinks while mutating a rule action.
rewriteRuleAction neglected to check for SubLink nodes in thesecurityQuals of range table entries. This could lead to failingto convert such a SubLink to a SubPlan, resulting in assertioncrashes or weird errors later in planning.In passing, fix some poor coding in rewriteTargetView:we should not pass the source parsetree's hasSubLinksfield to ReplaceVarsFromTargetList's outer_hasSubLinks.ReplaceVarsFromTargetList knows enough to ignore thatwhen a Query node is passed, but it's still confusingand bad precedent: if we did try to update that flagwe'd be updating a stale copy of the parsetree.Per bug #17972 from Alexander Lakhin. This has been broken sincewe added RangeTblEntry.securityQuals (although the presented testcase only fails back to215b43c), so back-patch all the way.Discussion:https://postgr.es/m/17972-f422c094237847d0@postgresql.org1 parentedf1de6 commitb4110bd
File tree
3 files changed
+52
-1
lines changed- src
- backend/rewrite
- test/regress
- expected
- sql
3 files changed
+52
-1
lines changedLines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
472 | 472 |
| |
473 | 473 |
| |
474 | 474 |
| |
| 475 | + | |
| 476 | + | |
475 | 477 |
| |
476 | 478 |
| |
477 | 479 |
| |
| |||
3304 | 3306 |
| |
3305 | 3307 |
| |
3306 | 3308 |
| |
3307 |
| - | |
| 3309 | + | |
3308 | 3310 |
| |
3309 | 3311 |
| |
3310 | 3312 |
| |
|
Lines changed: 32 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2616 | 2616 |
| |
2617 | 2617 |
| |
2618 | 2618 |
| |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
2619 | 2651 |
| |
2620 | 2652 |
| |
2621 | 2653 |
| |
|
Lines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1243 | 1243 |
| |
1244 | 1244 |
| |
1245 | 1245 |
| |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
1246 | 1263 |
| |
1247 | 1264 |
| |
1248 | 1265 |
| |
|
0 commit comments
Comments
(0)