Missing test of SPI copy functionality - Mailing list pgsql-hackers

From Mark Dilger
Subject Missing test of SPI copy functionality
Date
Msg-id a6e9b130-7fd5-387b-4ec5-89bda24373ab@gmail.com
Whole thread Raw
Responses Re: Missing test of SPI copy functionality  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: Grigory Smolkin
Date:
Subject: Re: [proposal] recovery_target "latest"
Next
From: Andrew Dunstan
Date:
Subject: Re: TAP tests aren't using the magic words for Windows file access