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
Discussion:
@@ -2461,8 +2461,12 @@ query_to_oid_list(const char *query)
{
uint64 i;
List *list = NIL;
+ int spi_result;
- SPI_execute(query, true, 0);
+ spi_result = SPI_execute(query, true, 0);
+ if (spi_result != SPI_OK_SELECT)
+ elog(ERROR, "SPI_execute returned %s for %s",
+ SPI_result_code_string(spi_result), query);
for (i = 0; i < SPI_processed; i++)
{
