forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit597e41e
committed
Fix json_to_record() bug with nested objects.
A thinko concerning nesting depth caused json_to_record() to produce bogusoutput if a field of its input object contained a sub-object with a fieldname matching one of the requested output column names. Per bug #13996from Johann Visagie.I added a regression test case based on his example, plus parallel testsfor json_to_recordset, jsonb_to_record, jsonb_to_recordset. The latterthree do not exhibit the same bug (which suggests that we may be missingsome opportunities to share code...) but testing seems like a good ideain any case.Back-patch to 9.4 where these functions were introduced.1 parent55965eb commit597e41e
File tree
5 files changed
+49
-2
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
5 files changed
+49
-2
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2350 | 2350 |
| |
2351 | 2351 |
| |
2352 | 2352 |
| |
2353 |
| - | |
| 2353 | + | |
2354 | 2354 |
| |
2355 | 2355 |
| |
2356 | 2356 |
| |
|
Lines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1552 | 1552 |
| |
1553 | 1553 |
| |
1554 | 1554 |
| |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + |
Lines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1760 | 1760 |
| |
1761 | 1761 |
| |
1762 | 1762 |
| |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
1763 | 1779 |
| |
1764 | 1780 |
| |
1765 | 1781 |
| |
|
Lines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
487 | 487 |
| |
488 | 488 |
| |
489 | 489 |
| |
490 |
| - | |
491 | 490 |
| |
492 | 491 |
| |
493 | 492 |
| |
| |||
498 | 497 |
| |
499 | 498 |
| |
500 | 499 |
| |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + |
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
372 | 372 |
| |
373 | 373 |
| |
374 | 374 |
| |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
375 | 383 |
| |
376 | 384 |
| |
377 | 385 |
| |
|
0 commit comments
Comments
(0)