forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commit900a9fd
committed
Fix some oversights in expression dependency recording.
find_expr_references() neglected to record a dependency on the result typeof a FieldSelect node, allowing a DROP TYPE to break a view or rule thatcontains such an expression. I think we'd omitted this case intentionally,reasoning that there would always be a related dependency ensuring that theDROP would cascade to the view. But at least with nested field selectionexpressions, that's not true, as shown in bug #14867 from Mansur Galiev.Add the dependency, and for good measure a dependency on the node's exposedcollation.Likewise add a dependency on the result type of a FieldStore. I think herethe reasoning was that it'd only appear within an assignment to a field,and the dependency on the field's column would be enough ... but havingseen this example, I think that's wrong for nested-composites cases.Looking at nearby code, I notice we're not recording a dependency on theexposed collation of CoerceViaIO, which seems inconsistent with our choicesfor related node types. Maybe that's OK but I'm feeling suspicious of thiscode today, so let's add that; it certainly can't hurt.This patch does not do anything to protect already-existing views, onlyviews created after it's installed. But seeing that the issue has beenthere a very long time and nobody noticed till now, that's probably goodenough.Back-patch to all supported branches.Discussion:https://postgr.es/m/20171023150118.1477.19174@wrigleys.postgresql.org1 parent0270ad1 commit900a9fd
1 file changed
+26
-0
lines changedLines changed: 26 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1639 | 1639 |
| |
1640 | 1640 |
| |
1641 | 1641 |
| |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
1642 | 1663 |
| |
1643 | 1664 |
| |
1644 | 1665 |
| |
| |||
1659 | 1680 |
| |
1660 | 1681 |
| |
1661 | 1682 |
| |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
1662 | 1688 |
| |
1663 | 1689 |
| |
1664 | 1690 |
| |
|
0 commit comments
Comments
(0)