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
This commit is contained in:
parent
6e3e6cc0e8
commit
3feb6ace7c
@ -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++)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user