Commit 8529036
committed
Fix assorted small bugs in ThrowErrorData().
Copy the palloc'd strings into the correct context, ie ErrorContext
not wherever the source ErrorData is. This would be a large bug,
except that it appears that all catchers of thrown errors do either
EmitErrorReport or CopyErrorData before doing anything that would
cause transient memory contexts to be cleaned up. Still, it's wrong
and it will bite somebody someday.
Fix failure to copy cursorpos and internalpos.
Utter the appropriate incantations involving recursion_depth, so that
we'll behave sanely if we get an error inside pstrdup. (In general,
the body of this function ought to act like, eg, errdetail().)
Per code reading induced by Jakob Egger's report.1 parent fbf28b6 commit 8529036
1 file changed
+14
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1601 | 1601 | | |
1602 | 1602 | | |
1603 | 1603 | | |
1604 | | - | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
1605 | 1608 | | |
1606 | 1609 | | |
1607 | 1610 | | |
| |||
1613 | 1616 | | |
1614 | 1617 | | |
1615 | 1618 | | |
1616 | | - | |
| 1619 | + | |
1617 | 1620 | | |
1618 | 1621 | | |
1619 | | - | |
| 1622 | + | |
| 1623 | + | |
1620 | 1624 | | |
1621 | | - | |
1622 | | - | |
| 1625 | + | |
| 1626 | + | |
1623 | 1627 | | |
1624 | 1628 | | |
1625 | 1629 | | |
| |||
1631 | 1635 | | |
1632 | 1636 | | |
1633 | 1637 | | |
| 1638 | + | |
1634 | 1639 | | |
1635 | 1640 | | |
1636 | 1641 | | |
| |||
1641 | 1646 | | |
1642 | 1647 | | |
1643 | 1648 | | |
| 1649 | + | |
| 1650 | + | |
1644 | 1651 | | |
1645 | 1652 | | |
1646 | 1653 | | |
1647 | 1654 | | |
| 1655 | + | |
1648 | 1656 | | |
| 1657 | + | |
1649 | 1658 | | |
1650 | 1659 | | |
1651 | 1660 | | |
| |||
0 commit comments