forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit57d8c12
committed
Fix handling of nested JSON objects in json_populate_recordset and friends.
populate_recordset_object_start() improperly created a new hash table(overwriting the link to the existing one) if called at nest levelsgreater than one. This resulted in previous fields not appearing inthe final output, as reported by Matti Hameister in bug #10728.In 9.4 the problem also affects json_to_recordset.This perhaps missed detection earlier because the default behavior is tothrow an error for nested objects: you have to pass use_json_as_text = trueto see the problem.In addition, fix query-lifespan leakage of the hashtable created byjson_populate_record(). This is pretty much the same problem recentlyfixed in dblink: creating an intended-to-be-temporary context underneaththe executor's per-tuple context isn't enough to make it go away at theend of the tuple cycle, because MemoryContextReset is notMemoryContextResetAndDeleteChildren.Michael Paquier and Tom Lane1 parent0f74827 commit57d8c12
File tree
4 files changed
+58
-6
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
4 files changed
+58
-6
lines changedLines changed: 22 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2075 | 2075 |
| |
2076 | 2076 |
| |
2077 | 2077 |
| |
| 2078 | + | |
| 2079 | + | |
2078 | 2080 |
| |
2079 |
| - | |
| 2081 | + | |
2080 | 2082 |
| |
2081 | 2083 |
| |
2082 | 2084 |
| |
| |||
2250 | 2252 |
| |
2251 | 2253 |
| |
2252 | 2254 |
| |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
2253 | 2258 |
| |
2254 | 2259 |
| |
2255 | 2260 |
| |
| |||
2735 | 2740 |
| |
2736 | 2741 |
| |
2737 | 2742 |
| |
| 2743 | + | |
2738 | 2744 |
| |
2739 | 2745 |
| |
2740 | 2746 |
| |
2741 | 2747 |
| |
2742 |
| - | |
2743 |
| - | |
2744 |
| - | |
2745 |
| - | |
2746 | 2748 |
| |
2747 |
| - | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
2748 | 2760 |
| |
2749 | 2761 |
| |
2750 | 2762 |
| |
| |||
2771 | 2783 |
| |
2772 | 2784 |
| |
2773 | 2785 |
| |
| 2786 | + | |
2774 | 2787 |
| |
2775 | 2788 |
| |
2776 | 2789 |
| |
| 2790 | + | |
2777 | 2791 |
| |
2778 | 2792 |
| |
2779 | 2793 |
| |
| |||
2865 | 2879 |
| |
2866 | 2880 |
| |
2867 | 2881 |
| |
| 2882 | + | |
2868 | 2883 |
| |
| 2884 | + | |
2869 | 2885 |
| |
2870 | 2886 |
| |
2871 | 2887 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1007 | 1007 |
| |
1008 | 1008 |
| |
1009 | 1009 |
| |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
1010 | 1017 |
| |
1011 | 1018 |
| |
1012 | 1019 |
| |
| |||
1223 | 1230 |
| |
1224 | 1231 |
| |
1225 | 1232 |
| |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + |
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1007 | 1007 |
| |
1008 | 1008 |
| |
1009 | 1009 |
| |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
1010 | 1017 |
| |
1011 | 1018 |
| |
1012 | 1019 |
| |
| |||
1219 | 1226 |
| |
1220 | 1227 |
| |
1221 | 1228 |
| |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + |
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
325 | 325 |
| |
326 | 326 |
| |
327 | 327 |
| |
| 328 | + | |
| 329 | + | |
| 330 | + | |
328 | 331 |
| |
329 | 332 |
| |
330 | 333 |
| |
| |||
447 | 450 |
| |
448 | 451 |
| |
449 | 452 |
| |
| 453 | + | |
| 454 | + | |
| 455 | + |
0 commit comments
Comments
(0)