forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8571ecb
committed
Fix JSON aggregates to work properly when final function is re-executed.
Davide S. reported that json_agg() sometimes produced multiple trailingright brackets. This turns out to be because json_agg_finalfn() attachesthe final right bracket, and was doing so by modifying the aggregate statein-place. That's verboten, though unfortunately it seems there's no wayfor nodeAgg.c to check for such mistakes.Fix that back to 9.3 where the broken code was introduced. In 9.4 andHEAD, likewise fix json_object_agg(), which had copied the erroneous logic.Make some cosmetic cleanups as well.1 parent10b81fb commit8571ecb
1 file changed
+28
-4
lines changedLines changed: 28 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
85 | 85 |
| |
86 | 86 |
| |
87 | 87 |
| |
| 88 | + | |
88 | 89 |
| |
89 | 90 |
| |
90 | 91 |
| |
| |||
166 | 167 |
| |
167 | 168 |
| |
168 | 169 |
| |
169 |
| - | |
| 170 | + | |
170 | 171 |
| |
171 | 172 |
| |
172 | 173 |
| |
| |||
191 | 192 |
| |
192 | 193 |
| |
193 | 194 |
| |
194 |
| - | |
| 195 | + | |
195 | 196 |
| |
196 | 197 |
| |
197 | 198 |
| |
| |||
1359 | 1360 |
| |
1360 | 1361 |
| |
1361 | 1362 |
| |
| 1363 | + | |
1362 | 1364 |
| |
1363 | 1365 |
| |
1364 | 1366 |
| |
| |||
1646 | 1648 |
| |
1647 | 1649 |
| |
1648 | 1650 |
| |
| 1651 | + | |
| 1652 | + | |
1649 | 1653 |
| |
1650 | 1654 |
| |
1651 | 1655 |
| |
| |||
1732 | 1736 |
| |
1733 | 1737 |
| |
1734 | 1738 |
| |
| 1739 | + | |
1735 | 1740 |
| |
1736 | 1741 |
| |
1737 | 1742 |
| |
1738 |
| - | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
1739 | 1763 |
| |
1740 |
| - | |
| 1764 | + | |
1741 | 1765 |
| |
1742 | 1766 |
| |
1743 | 1767 |
| |
|
0 commit comments
Comments
(0)