- Notifications
You must be signed in to change notification settings - Fork28
Commit285b850
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 parentb1752c3 commit285b850
1 file changed
+26
-0
lines changedLines changed: 26 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1710 | 1710 |
| |
1711 | 1711 |
| |
1712 | 1712 |
| |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
1713 | 1734 |
| |
1714 | 1735 |
| |
1715 | 1736 |
| |
| |||
1730 | 1751 |
| |
1731 | 1752 |
| |
1732 | 1753 |
| |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
1733 | 1759 |
| |
1734 | 1760 |
| |
1735 | 1761 |
| |
|
0 commit comments
Comments
(0)