Missing cases from SPI_result_code_string()

Started by Dean Rasheedabout 3 years ago4 messageshackers
Jump to latest
#1Dean Rasheed
dean.a.rasheed@gmail.com

Another one noticed from the MERGE RETURNING patch -- the switch
statement in SPI_result_code_string() is missing cases for
SPI_OK_TD_REGISTER and SPI_OK_MERGE.

The SPI_OK_TD_REGISTER case goes back all the way, so I suppose it
should be back-patched to all supported branches, though evidently
this is not something anyone is likely to care about.

The SPI_OK_MERGE case is perhaps a little more visible (e.g., execute
MERGE from PL/Perl using $rv = spi_exec_query() and then examine
$rv->{status}). It's also missing from the docs for SPI_Execute().
Having tested that it now works as expected, I don't think there's
much point in adding a regression test case for it though.

Regards,
Dean

Attachments:

SPI_result_code_string.patchtext/x-patch; charset=US-ASCII; name=SPI_result_code_string.patchDownload+13-0
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Dean Rasheed (#1)
Re: Missing cases from SPI_result_code_string()

Dean Rasheed <dean.a.rasheed@gmail.com> writes:

Another one noticed from the MERGE RETURNING patch -- the switch
statement in SPI_result_code_string() is missing cases for
SPI_OK_TD_REGISTER and SPI_OK_MERGE.

Ugh. Grepping around, it looks like pltcl_process_SPI_result
is missing a case for SPI_OK_MERGE as well.

regards, tom lane

#3Dean Rasheed
dean.a.rasheed@gmail.com
In reply to: Tom Lane (#2)
Re: Missing cases from SPI_result_code_string()

On Mon, 20 Feb 2023 at 19:39, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Ugh. Grepping around, it looks like pltcl_process_SPI_result
is missing a case for SPI_OK_MERGE as well.

Yes, I was about to post a patch for that too. That's the last case
that I found, looking around.

Regards,
Dean

#4Dean Rasheed
dean.a.rasheed@gmail.com
In reply to: Dean Rasheed (#3)
Re: Missing cases from SPI_result_code_string()

On Mon, 20 Feb 2023 at 19:49, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:

On Mon, 20 Feb 2023 at 19:39, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Ugh. Grepping around, it looks like pltcl_process_SPI_result
is missing a case for SPI_OK_MERGE as well.

Yes, I was about to post a patch for that too. That's the last case
that I found, looking around.

OK, I've pushed fixes for those.

Regards,
Dean