Fix cross-version upgrade tests.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 11 Nov 2024 18:57:21 +0000 (13:57 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 11 Nov 2024 18:57:41 +0000 (13:57 -0500)
TestUpgradeXversion knows how to make the main regression database's
references to pg_regress.so be version-independent.  But it doesn't
do that for plperl's database, so that the C function added by
commit b7e3a52a8 is causing cross-version upgrade test failures.
Path of least resistance is to just drop the function at the end
of the new test.

In <= v14, also take the opportunity to clean up the generated
test files.

Security: CVE-2024-10979

src/pl/plperl/GNUmakefile
src/pl/plperl/input/plperl_env.source
src/pl/plperl/output/plperl_env.source

index 01588d016a0637a24c78c3ad8df5aa1e294e53b5..61376cdde73644550d62536082e3a25b111db90d 100644 (file)
@@ -124,6 +124,7 @@ submake:
 
 clean distclean maintainer-clean: clean-lib
    rm -f SPI.c Util.c $(OBJS) perlchunks.h plperl_opmask.h
+   rm -f sql/plperl_env.sql expected/plperl_env.out
    rm -rf $(pg_regress_clean_files)
 ifeq ($(PORTNAME), win32)
    rm -f $(perlwithver).def
index 8fe526e1b8bb13aa67e7c2ae7d9984e71032a4f9..49f03acb1dce784c6901631e8ea6bf3892eca647 100644 (file)
@@ -50,3 +50,6 @@ $$
    }
 
 $$ LANGUAGE plperl;
+
+-- clean up to simplify cross-version upgrade testing
+DROP FUNCTION get_environ();
index 37b7e23d5ce7c79d516770a059b28b32fc8f084a..ef75d5d55568b8c45a886dab524cf1a78e9fde81 100644 (file)
@@ -47,3 +47,5 @@ $$
 $$ LANGUAGE plperl;
 WARNING:  attempted alteration of $ENV{TEST_PLPERL_ENV_FOO} at line 12.
 NOTICE:  environ unaffected
+-- clean up to simplify cross-version upgrade testing
+DROP FUNCTION get_environ();