postgres.git / summary / log / commit / refs

commit    6ad01b1152643763e485425f84d03a6777d8ba15
Author:   Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date:     Fri Jan 16 12:42:22 2026 +0000
First released in: 19.0, 17.8, 18.2

    Fix crash in test function on removable_cutoff(NULL)
    
    The function is part of the injection_points test module and only used
    in tests. None of the current tests call it with a NULL argument, but
    it is supposed to work.
    
    Backpatch-through: 17


src/test/modules/injection_points/regress_injection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/modules/injection_points/regress_injection.c b/src/test/modules/injection_points/regress_injection.c index 7bba1c97d0f..524790a90ed 100644 --- a/src/test/modules/injection_points/regress_injection.c +++ b/src/test/modules/injection_points/regress_injection.c @@ -50,7 +50,7 @@ removable_cutoff(PG_FUNCTION_ARGS) if (!PG_ARGISNULL(0)) rel = table_open(PG_GETARG_OID(0), AccessShareLock); - if (!rel->rd_rel->relisshared && autovacuum_start_daemon) + if (rel != NULL && !rel->rd_rel->relisshared && autovacuum_start_daemon) elog(WARNING, "removable_cutoff(non-shared-rel) can move backward under autovacuum=on"); [parent: 4071fe900e67]