From 19ec379b15a9e04f22bc33285628872ab831825e Mon Sep 17 00:00:00 2001 From: "df@kahlann.erinye.com" <> Date: Thu, 7 Dec 2006 16:06:29 +0100 Subject: [PATCH] do not autorelease build ids when a child of mysql-test-run.pl dies --- mysql-test/lib/mtr_unique.pl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mysql-test/lib/mtr_unique.pl b/mysql-test/lib/mtr_unique.pl index a8fb320c773..3adc8413576 100644 --- a/mysql-test/lib/mtr_unique.pl +++ b/mysql-test/lib/mtr_unique.pl @@ -10,10 +10,16 @@ use Fcntl ':flock'; # Requested IDs are stored in a hash and released upon END. # my %mtr_unique_assigned_ids = (); +my $mtr_unique_pid; +BEGIN { + $mtr_unique_pid = $$ unless defined $mtr_unique_pid; +} END { - while(my ($id,$file) = each(%mtr_unique_assigned_ids)) { - print "Autoreleasing $file:$id\n"; - mtr_release_unique_id($file, $id); + if($mtr_unique_pid == $$) { + while(my ($id,$file) = each(%mtr_unique_assigned_ids)) { + print "Autoreleasing $file:$id\n"; + mtr_release_unique_id($file, $id); + } } }