aboutsummaryrefslogtreecommitdiff
path: root/src/tutorial/complex.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-06-24 21:22:40 -0700
committerTom Lane <tgl@sss.pgh.pa.us>2014-06-24 21:22:40 -0700
commit57d8c1270e1538d1f02e4fa1cdb1d8ded82f7c70 (patch)
tree77920b87a258d8c93915f8f0cb3d15c9d4d37f2c /src/tutorial/complex.c
parent0f7482733a90a2e0d8917a41d823306975f291ee (diff)
downloadpostgresql-57d8c1270e1538d1f02e4fa1cdb1d8ded82f7c70.tar.gz
postgresql-57d8c1270e1538d1f02e4fa1cdb1d8ded82f7c70.zip
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 levels greater than one. This resulted in previous fields not appearing in the 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 to throw an error for nested objects: you have to pass use_json_as_text = true to see the problem. In addition, fix query-lifespan leakage of the hashtable created by json_populate_record(). This is pretty much the same problem recently fixed in dblink: creating an intended-to-be-temporary context underneath the executor's per-tuple context isn't enough to make it go away at the end of the tuple cycle, because MemoryContextReset is not MemoryContextResetAndDeleteChildren. Michael Paquier and Tom Lane
Diffstat (limited to 'src/tutorial/complex.c')
0 files changed, 0 insertions, 0 deletions