Add missing support for the latest SPI status codes.
authorDean Rasheed <[email protected]>
Wed, 22 Feb 2023 13:27:29 +0000 (13:27 +0000)
committerDean Rasheed <[email protected]>
Wed, 22 Feb 2023 13:27:29 +0000 (13:27 +0000)
SPI_result_code_string() was missing support for SPI_OK_TD_REGISTER,
and in v15 and later, it was missing support for SPI_OK_MERGE, as was
pltcl_process_SPI_result().

The last of those would trigger an error if a MERGE was executed from
PL/Tcl. The others seem fairly innocuous, but worth fixing.

Back-patch to all supported branches. Before v15, this is just adding
SPI_OK_TD_REGISTER to SPI_result_code_string(), which is unlikely to
be seen by anyone, but seems worth doing for completeness.

Reviewed by Tom Lane.

Discussion:
  https://postgr.es/m/CAEZATCUg8V%2BK%2BGcafOPqymxk84Y_prXgfe64PDoopjLFH6Z0Aw%40mail.gmail.com
  https://postgr.es/m/CAEZATCUMe%2B_KedPMM9AxKqm%3DSZogSxjUcrMe%2BsakusZh3BFcQw%40mail.gmail.com

src/backend/executor/spi.c

index f2b3b3df98a522f100e3a432a62da15a9209cfe1..a90851cadae96bfa50d9669b89e39948b204329c 100644 (file)
@@ -1860,6 +1860,8 @@ SPI_result_code_string(int code)
            return "SPI_OK_REL_REGISTER";
        case SPI_OK_REL_UNREGISTER:
            return "SPI_OK_REL_UNREGISTER";
+       case SPI_OK_TD_REGISTER:
+           return "SPI_OK_TD_REGISTER";
    }
    /* Unrecognized code ... return something useful ... */
    sprintf(buf, "Unrecognized SPI code %d", code);