Re: pg_stat_get_replication_slot() marked not strict, crashes

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org, Amit Kapila <amit.kapila16@gmail.com>
Date: 2022-03-26T21:41:53Z
Lists: pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> I wonder if we ought to make PG_GETARG_DATUM(n) assert that !PG_ARGISNULL(n)?
> That'd perhaps make it easier to catch some of these...

Don't see the point; such cases will crash just fine without any
assert.  The problem is lack of test coverage ...

> It'd be nice to have a test in sanity check to just call each non-strict
> function with NULL inputs automatically. But the potential side-effects
> probably makes that not a realistic option?

... and as you say, brute force testing seems difficult.  I'm
particularly worried about multi-argument functions, as in
principle we'd need to check each argument separately, and cons
up something plausible to pass to the other arguments.

			regards, tom lane



Commits

  1. Mark pg_stat_get_subscription_stats() strict.

  2. Fix NULL input behaviour of pg_stat_get_replication_slot().