Skip to content

Commit c26dd8e

Browse files
Bjorn MunchBjorn Munch
Bjorn Munch
authored and
Bjorn Munch
committed
Bug #45771 AIX and i5/OS Perl bug: check_socket_path_length in MTR fails
Bug is actually in Perl Fixed by trapping and ignoring error from IO::Socket::UNIX
1 parent ad771f0 commit c26dd8e

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

mysql-test/lib/My/Platform.pm

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,29 @@ sub check_socket_path_length {
126126
die "Could not create UNIX domain socket: $!"
127127
unless defined $sock;
128128

129+
my $hostpath = eval {$sock->hostpath()};
130+
if ($@) {
131+
die unless $@ =~ /^Bad arg length for Socket::unpack_sockaddr_un/;
132+
133+
# Bug on AIX and i5/OS Perl IO::Socket::UNIX which dies with something
134+
# like:
135+
# Bad arg length for Socket::unpack_sockaddr_un, length is 25,
136+
# should be 106 at /path/to/perl/lib/5.8.0/aix/Socket.pm line 380.
137+
#
138+
# Just fake it that everything is fine
139+
$hostpath = $testfile;
140+
}
141+
129142
die "UNIX domain socket path was truncated"
130-
unless ($testfile eq $sock->hostpath());
143+
unless ($testfile eq $hostpath);
131144

132145
$truncated= 0; # Yes, it worked!
133146

134147
};
135148

149+
die "Unexpected failure when checking socket path length: $@"
150+
if $@ and $@ !~ /^UNIX domain socket path was truncated/;
151+
136152
$sock= undef; # Close socket
137153
rmtree($tmpdir); # Remove the tempdir and any socket file created
138154
return $truncated;

0 commit comments

Comments
 (0)