- Notifications
You must be signed in to change notification settings - Fork5k
Commit1487ca0
committed
Fix dangling-pointer problem in before-row update trigger processing.
ExecUpdate checked for whether ExecBRUpdateTriggers had returned a newtuple value by seeing if the returned tuple was pointer-equal to the oldone. But the "old one" was in estate->es_junkFilter's result slot, whichwould be scribbled on if we had done an EvalPlanQual update in response toa concurrent update of the target tuple; therefore we were comparing adangling pointer to a live one. Given the right set of circumstances wecould get a false match, resulting in not forcing the tuple to be stored inthe slot we thought it was stored in. In the case reported by Maxim Bogukin bug #5798, this led to "cannot extract system attribute from virtualtuple" failures when trying to do "RETURNING ctid". I believe there is avery-low-probability chance of more serious errors, such as generatingincorrect index entries based on the original rather than thetrigger-modified version of the row.In HEAD, change all of ExecBRInsertTriggers, ExecIRInsertTriggers,ExecBRUpdateTriggers, and ExecIRUpdateTriggers so that they continue tohave similar APIs. In the back branches I just changedExecBRUpdateTriggers, since there is no bug in the ExecBRInsertTriggerscase.1 parent69bef7f commit1487ca0
File tree
3 files changed
+49
-33
lines changed- src
- backend
- commands
- executor
- include/commands
3 files changed
+49
-33
lines changedLines changed: 41 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1620 | 1620 |
| |
1621 | 1621 |
| |
1622 | 1622 |
| |
1623 |
| - | |
| 1623 | + | |
1624 | 1624 |
| |
1625 |
| - | |
| 1625 | + | |
1626 | 1626 |
| |
1627 | 1627 |
| |
1628 | 1628 |
| |
1629 | 1629 |
| |
1630 | 1630 |
| |
| 1631 | + | |
| 1632 | + | |
1631 | 1633 |
| |
1632 | 1634 |
| |
1633 | 1635 |
| |
1634 |
| - | |
1635 | 1636 |
| |
1636 | 1637 |
| |
1637 | 1638 |
| |
| |||
1640 | 1641 |
| |
1641 | 1642 |
| |
1642 | 1643 |
| |
1643 |
| - | |
1644 |
| - | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
1645 | 1653 |
| |
1646 | 1654 |
| |
1647 |
| - | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
1648 | 1660 |
| |
1649 | 1661 |
| |
1650 | 1662 |
| |
| |||
1667 | 1679 |
| |
1668 | 1680 |
| |
1669 | 1681 |
| |
1670 |
| - | |
| 1682 | + | |
1671 | 1683 |
| |
1672 | 1684 |
| |
1673 |
| - | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
1674 | 1689 |
| |
1675 | 1690 |
| |
1676 |
| - | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
1677 | 1709 |
| |
1678 | 1710 |
| |
1679 | 1711 |
| |
|
Lines changed: 6 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1678 | 1678 |
| |
1679 | 1679 |
| |
1680 | 1680 |
| |
1681 |
| - | |
1682 |
| - | |
1683 |
| - | |
1684 |
| - | |
1685 |
| - | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
1686 | 1684 |
| |
1687 |
| - | |
| 1685 | + | |
1688 | 1686 |
| |
1689 | 1687 |
| |
1690 |
| - | |
1691 |
| - | |
1692 |
| - | |
1693 |
| - | |
1694 |
| - | |
1695 |
| - | |
1696 |
| - | |
1697 |
| - | |
1698 |
| - | |
1699 |
| - | |
1700 |
| - | |
1701 |
| - | |
1702 |
| - | |
1703 |
| - | |
1704 |
| - | |
1705 |
| - | |
| 1688 | + | |
| 1689 | + | |
1706 | 1690 |
| |
1707 | 1691 |
| |
1708 | 1692 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
147 | 147 |
| |
148 | 148 |
| |
149 | 149 |
| |
150 |
| - | |
| 150 | + | |
151 | 151 |
| |
152 | 152 |
| |
153 |
| - | |
| 153 | + | |
154 | 154 |
| |
155 | 155 |
| |
156 | 156 |
| |
|
0 commit comments
Comments
(0)