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

From Michael Paquier
Subject Re: Missing test of SPI copy functionality
Date
Msg-id 20191107022716.GF1768@paquier.xyz
Whole thread Raw
In response to Missing test of SPI copy functionality  (Mark Dilger <hornschnorter@gmail.com>)
Responses Re: Missing test of SPI copy functionality  (Mark Dilger <hornschnorter@gmail.com>)
List pgsql-hackers
On Wed, Nov 06, 2019 at 04:16:14PM -0800, Mark Dilger wrote:
> 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?

Hard to say, but I think that it would be good to test that part
independently anyway.  The transaction part close by is actually
getting stressed with plpgsql_transaction, so the split done in your
patch looks fine.  I'll look at it again in a couple of days to
double-check for missing spots, and commit it if there are no
objections.

> 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:

If you use "Assert(false)", you would get in bonus the call stack.  I
use this trick from time to time.

> 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.

Thanks for doing so.  I can see that it has been added to the CF app:
https://commitfest.postgresql.org/26/2350/
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: RFC: split OBJS lines to one object per line
Next
From: Paul A Jungwirth
Date:
Subject: Re: range_agg