]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix crash in test function on removable_cutoff(NULL)
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 16 Jan 2026 12:42:22 +0000 (14:42 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 16 Jan 2026 12:42:22 +0000 (14:42 +0200)
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

index f802db5b68aa3b68da8c901c3eb2ac651534c080..0c3113eac2f6a5c4b787d9e668d202c34e10a616 100644 (file)
@@ -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");