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