From 43ddbf8a933b8f9849a63f53733b3386db905ef3 Mon Sep 17 00:00:00 2001
From: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Date: Tue, 17 Mar 2026 11:52:59 +0900
Subject: [PATCH] Fix the test 007_multixact_conversion.pl

pg_upgrade test 007_multixact_conversion.pl was leaving files like
delete_old_cluster.sh in the source directory for VPATH and meson builds.
The fix is to change the directory to tmp_check before running the test as
is done in the similar test in 002_pg_upgrade.
---
 src/bin/pg_upgrade/t/007_multixact_conversion.pl | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/bin/pg_upgrade/t/007_multixact_conversion.pl b/src/bin/pg_upgrade/t/007_multixact_conversion.pl
index d18c50830d5..867a0623153 100644
--- a/src/bin/pg_upgrade/t/007_multixact_conversion.pl
+++ b/src/bin/pg_upgrade/t/007_multixact_conversion.pl
@@ -357,6 +357,11 @@ sub upgrade_and_compare
 		'multixact members from original and upgraded clusters match');
 }
 
+# In a VPATH build, we'll be started in the source directory, but we want
+# to run pg_upgrade in the build directory so that any files generated finish
+# in it, like delete_old_cluster.{sh,bat}.
+chdir ${PostgreSQL::Test::Utils::tmp_check};
+
 my $old_version;
 
 # Basic scenario: Create a cluster using old installation, run
-- 
2.47.3

