Re: Missing test of SPI copy functionality

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Mark Dilger <hornschnorter(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Missing test of SPI copy functionality
Date: 2019-11-07 02:27:16
Message-ID: 20191107022716.GF1768@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Paul A Jungwirth 2019-11-07 02:35:28 Re: range_agg
Previous Message Michael Paquier 2019-11-07 02:24:37 Re: RFC: split OBJS lines to one object per line