Hackers,
While working on cleaning up the SPI interface, I found that one of the
SPI error codes, SPI_ERROR_COPY, is never encountered in any test case
when running `make check-world`. This case is certainly reachable by a
user, as is shown in the attached patch. Is this tested from some other
infrastructure?
To verify that SPI_ERROR_COPY is not tested, before and after applying
the patch, try this modification, and notice before the patch that the
fatal error is never encountered:
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c
index 2c0ae395ba..ced38abbf6 100644
--- a/src/backend/executor/spi.c
+++ b/src/backend/executor/spi.c
@@ -2245,6 +2245,7 @@ _SPI_execute_plan(SPIPlanPtr plan, ParamListInfo
paramLI,
if (cstmt->filename == NULL)
{
+ elog(FATAL, "SPI_ERROR_COPY tested");
my_res = SPI_ERROR_COPY;
goto fail;
}
I am submitting this patch separately from other patches related to SPI,
since (a) it does not touch any of the SPI code, (b) it fixes missing
test coverage to do with COPY and PL/pgSQL, only indirectly to do with
SPI, and (c) it should be possible to commit this patch even if other
SPI patches are rejected.
--
Mark Dilger