pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Don't crash if cursor_to_xmlschema is used on a non-data-returni
7+ messages / 1 participants
[nested] [flat]

* pgsql: Don't crash if cursor_to_xmlschema is used on a non-data-returni
@ 2023-09-18 18:28 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2023-09-18 18:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't crash if cursor_to_xmlschema is used on a non-data-returning Portal.

cursor_to_xmlschema() assumed that any Portal must have a tupDesc,
which is not so.  Add a defensive check.

It's plausible that this mistake occurred because of the rather
poorly chosen name of the lookup function SPI_cursor_find(),
which in such cases is returning something that isn't very much
like a cursor.  Add some documentation to try to forestall future
errors of the same ilk.

Report and patch by Boyu Yang (docs changes by me).  Back-patch
to all supported branches.

Discussion: https://postgr.es/m/dd343010-c637-434c-a8cb-418f53bda3b8.yangboyu.yby@alibaba-inc.com

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/spi.sgml       | 13 +++++++++++++
src/backend/utils/adt/xml.c |  4 ++++
2 files changed, 17 insertions(+)



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

* pgsql: Don't crash if cursor_to_xmlschema is used on a non-data-returni
@ 2023-09-18 18:28 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2023-09-18 18:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't crash if cursor_to_xmlschema is used on a non-data-returning Portal.

cursor_to_xmlschema() assumed that any Portal must have a tupDesc,
which is not so.  Add a defensive check.

It's plausible that this mistake occurred because of the rather
poorly chosen name of the lookup function SPI_cursor_find(),
which in such cases is returning something that isn't very much
like a cursor.  Add some documentation to try to forestall future
errors of the same ilk.

Report and patch by Boyu Yang (docs changes by me).  Back-patch
to all supported branches.

Discussion: https://postgr.es/m/dd343010-c637-434c-a8cb-418f53bda3b8.yangboyu.yby@alibaba-inc.com

Branch
------
REL_16_STABLE

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

Modified Files
--------------
doc/src/sgml/spi.sgml       | 13 +++++++++++++
src/backend/utils/adt/xml.c |  4 ++++
2 files changed, 17 insertions(+)



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

* pgsql: Don't crash if cursor_to_xmlschema is used on a non-data-returni
@ 2023-09-18 18:28 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2023-09-18 18:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't crash if cursor_to_xmlschema is used on a non-data-returning Portal.

cursor_to_xmlschema() assumed that any Portal must have a tupDesc,
which is not so.  Add a defensive check.

It's plausible that this mistake occurred because of the rather
poorly chosen name of the lookup function SPI_cursor_find(),
which in such cases is returning something that isn't very much
like a cursor.  Add some documentation to try to forestall future
errors of the same ilk.

Report and patch by Boyu Yang (docs changes by me).  Back-patch
to all supported branches.

Discussion: https://postgr.es/m/dd343010-c637-434c-a8cb-418f53bda3b8.yangboyu.yby@alibaba-inc.com

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/95f54f0d034eb69349f9134a01441a3cdd311419

Modified Files
--------------
doc/src/sgml/spi.sgml       | 13 +++++++++++++
src/backend/utils/adt/xml.c |  4 ++++
2 files changed, 17 insertions(+)



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

* pgsql: Don't crash if cursor_to_xmlschema is used on a non-data-returni
@ 2023-09-18 18:28 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2023-09-18 18:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't crash if cursor_to_xmlschema is used on a non-data-returning Portal.

cursor_to_xmlschema() assumed that any Portal must have a tupDesc,
which is not so.  Add a defensive check.

It's plausible that this mistake occurred because of the rather
poorly chosen name of the lookup function SPI_cursor_find(),
which in such cases is returning something that isn't very much
like a cursor.  Add some documentation to try to forestall future
errors of the same ilk.

Report and patch by Boyu Yang (docs changes by me).  Back-patch
to all supported branches.

Discussion: https://postgr.es/m/dd343010-c637-434c-a8cb-418f53bda3b8.yangboyu.yby@alibaba-inc.com

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9baabfa38e005699fc21d76875f03cc2f204258c

Modified Files
--------------
doc/src/sgml/spi.sgml       | 13 +++++++++++++
src/backend/utils/adt/xml.c |  4 ++++
2 files changed, 17 insertions(+)



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

* pgsql: Don't crash if cursor_to_xmlschema is used on a non-data-returni
@ 2023-09-18 18:28 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2023-09-18 18:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't crash if cursor_to_xmlschema is used on a non-data-returning Portal.

cursor_to_xmlschema() assumed that any Portal must have a tupDesc,
which is not so.  Add a defensive check.

It's plausible that this mistake occurred because of the rather
poorly chosen name of the lookup function SPI_cursor_find(),
which in such cases is returning something that isn't very much
like a cursor.  Add some documentation to try to forestall future
errors of the same ilk.

Report and patch by Boyu Yang (docs changes by me).  Back-patch
to all supported branches.

Discussion: https://postgr.es/m/dd343010-c637-434c-a8cb-418f53bda3b8.yangboyu.yby@alibaba-inc.com

Branch
------
REL_13_STABLE

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

Modified Files
--------------
doc/src/sgml/spi.sgml       | 13 +++++++++++++
src/backend/utils/adt/xml.c |  4 ++++
2 files changed, 17 insertions(+)



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

* pgsql: Don't crash if cursor_to_xmlschema is used on a non-data-returni
@ 2023-09-18 18:28 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2023-09-18 18:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't crash if cursor_to_xmlschema is used on a non-data-returning Portal.

cursor_to_xmlschema() assumed that any Portal must have a tupDesc,
which is not so.  Add a defensive check.

It's plausible that this mistake occurred because of the rather
poorly chosen name of the lookup function SPI_cursor_find(),
which in such cases is returning something that isn't very much
like a cursor.  Add some documentation to try to forestall future
errors of the same ilk.

Report and patch by Boyu Yang (docs changes by me).  Back-patch
to all supported branches.

Discussion: https://postgr.es/m/dd343010-c637-434c-a8cb-418f53bda3b8.yangboyu.yby@alibaba-inc.com

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1233370791fe12f7d9f7cb8b994cab70012bd961

Modified Files
--------------
doc/src/sgml/spi.sgml       | 13 +++++++++++++
src/backend/utils/adt/xml.c |  4 ++++
2 files changed, 17 insertions(+)



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

* pgsql: Don't crash if cursor_to_xmlschema is used on a non-data-returni
@ 2023-09-18 18:28 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2023-09-18 18:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't crash if cursor_to_xmlschema is used on a non-data-returning Portal.

cursor_to_xmlschema() assumed that any Portal must have a tupDesc,
which is not so.  Add a defensive check.

It's plausible that this mistake occurred because of the rather
poorly chosen name of the lookup function SPI_cursor_find(),
which in such cases is returning something that isn't very much
like a cursor.  Add some documentation to try to forestall future
errors of the same ilk.

Report and patch by Boyu Yang (docs changes by me).  Back-patch
to all supported branches.

Discussion: https://postgr.es/m/dd343010-c637-434c-a8cb-418f53bda3b8.yangboyu.yby@alibaba-inc.com

Branch
------
REL_11_STABLE

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

Modified Files
--------------
doc/src/sgml/spi.sgml       | 13 +++++++++++++
src/backend/utils/adt/xml.c |  4 ++++
2 files changed, 17 insertions(+)



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


end of thread, other threads:[~2023-09-18 18:28 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-09-18 18:28 pgsql: Don't crash if cursor_to_xmlschema is used on a non-data-returni Tom Lane <tgl@sss.pgh.pa.us>
2023-09-18 18:28 pgsql: Don't crash if cursor_to_xmlschema is used on a non-data-returni Tom Lane <tgl@sss.pgh.pa.us>
2023-09-18 18:28 pgsql: Don't crash if cursor_to_xmlschema is used on a non-data-returni Tom Lane <tgl@sss.pgh.pa.us>
2023-09-18 18:28 pgsql: Don't crash if cursor_to_xmlschema is used on a non-data-returni Tom Lane <tgl@sss.pgh.pa.us>
2023-09-18 18:28 pgsql: Don't crash if cursor_to_xmlschema is used on a non-data-returni Tom Lane <tgl@sss.pgh.pa.us>
2023-09-18 18:28 pgsql: Don't crash if cursor_to_xmlschema is used on a non-data-returni Tom Lane <tgl@sss.pgh.pa.us>
2023-09-18 18:28 pgsql: Don't crash if cursor_to_xmlschema is used on a non-data-returni 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