Skip to content

Commit 3feb6ac

Browse files
committed
Check after errors of SPI_execute() in xml.c
SPI gets used to build a list of relation OIDs for XML object generation, and one code path building a list uses SPI_execute() without looking at errors it produces. So fix that. Author: Mark Dilger Reviewed-by: Michael Paquier, Pavel Stehule Discussion: https://postgr.es/m/17d30445-4862-7917-170f-84328dcd292d@gmail.com
1 parent 6e3e6cc commit 3feb6ac

File tree

1 file changed

+5
-1
lines changed
  • src/backend/utils/adt

1 file changed

+5
-1
lines changed

src/backend/utils/adt/xml.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2461,8 +2461,12 @@ query_to_oid_list(const char *query)
24612461
{
24622462
uint64 i;
24632463
List *list = NIL;
2464+
int spi_result;
24642465

2465-
SPI_execute(query, true, 0);
2466+
spi_result = SPI_execute(query, true, 0);
2467+
if (spi_result != SPI_OK_SELECT)
2468+
elog(ERROR, "SPI_execute returned %s for %s",
2469+
SPI_result_code_string(spi_result), query);
24662470

24672471
for (i = 0; i < SPI_processed; i++)
24682472
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy