pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix another crash in json{b}_populate_recordset and json{b}_to_r
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix another crash in json{b}_populate_recordset and json{b}_to_r
@ 2018-11-22 20:14  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2018-11-22 20:14 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix another crash in json{b}_populate_recordset and json{b}_to_recordset.

populate_recordset_worker() failed to consider the possibility that the
supplied JSON data contains no rows, so that update_cached_tupdesc never
got called.  This led to a null-pointer dereference since commit 9a5e8ed28;
before that it led to a bogus "set-valued function called in context that
cannot accept a set" error.  Fix by forcing the update to happen.

Per bug #15514.  Back-patch to v11 as 9a5e8ed28 was.  (If we were excited
about the bogus error, we could perhaps go back further, but it'd take more
work to figure out how to fix it in older branches.  Given the lack of
field complaints about that aspect, I'm not excited.)

Discussion: https://postgr.es/m/15514-59d5b4c4065b178b@postgresql.org

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/595220a3a3a89e5648b7b6be726502efdc9ec806

Modified Files
--------------
src/backend/utils/adt/jsonfuncs.c   |  6 ++++++
src/test/regress/expected/json.out  | 13 +++++++++++++
src/test/regress/expected/jsonb.out | 13 +++++++++++++
src/test/regress/sql/json.sql       |  5 +++++
src/test/regress/sql/jsonb.sql      |  5 +++++
5 files changed, 42 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix another crash in json{b}_populate_recordset and json{b}_to_r
@ 2018-11-22 20:14  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2018-11-22 20:14 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix another crash in json{b}_populate_recordset and json{b}_to_recordset.

populate_recordset_worker() failed to consider the possibility that the
supplied JSON data contains no rows, so that update_cached_tupdesc never
got called.  This led to a null-pointer dereference since commit 9a5e8ed28;
before that it led to a bogus "set-valued function called in context that
cannot accept a set" error.  Fix by forcing the update to happen.

Per bug #15514.  Back-patch to v11 as 9a5e8ed28 was.  (If we were excited
about the bogus error, we could perhaps go back further, but it'd take more
work to figure out how to fix it in older branches.  Given the lack of
field complaints about that aspect, I'm not excited.)

Discussion: https://postgr.es/m/15514-59d5b4c4065b178b@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/eba2ce17121f198316d050e71d8bd049a43783ba

Modified Files
--------------
src/backend/utils/adt/jsonfuncs.c   |  6 ++++++
src/test/regress/expected/json.out  | 13 +++++++++++++
src/test/regress/expected/jsonb.out | 13 +++++++++++++
src/test/regress/sql/json.sql       |  5 +++++
src/test/regress/sql/jsonb.sql      |  5 +++++
5 files changed, 42 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2018-11-22 20:14 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-11-22 20:14 pgsql: Fix another crash in json{b}_populate_recordset and json{b}_to_r Tom Lane <tgl@sss.pgh.pa.us>
2018-11-22 20:14 pgsql: Fix another crash in json{b}_populate_recordset and json{b}_to_r Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox