Subject: | Makefile.PL --testport option does not work without --testhost |
Originally reported by Philip Stoev at
http://bugs.mysql.com/bug.php?id=27521
Description:
Hello,
if only --testport is specified for perl Makefile.PL, the tests will
fail to run properly.
if testport=1234 is specified, make test results in
DBI connect('test:1234','',...) failed: Can't connect to MySQL server on
'1234' (22) at 10connect.t line 25
strace reveals that a connection attempt is made to the default port of
a non-existant host.
How to repeat:
# perl Makefile.PL --testport=1234
# cd t
# perl 10connect.t
DBI connect('test:1234','',...) failed: Can't connect to MySQL server on
'1234' (22) at 10connect.t line 25
# Looks like your test died before it could output anything.
# strace perl 10connect.t 2>&1 | grep connect
connect(3, {sa_family=AF_INET, sin_port=htons(3306),
sin_addr=inet_addr("0.0.4.210")}, 16) = -1 EINVAL (Invalid argument
Suggested fix:
It would be nice to have a default of 127.0.0.1 for testhost if testport
is present. This way a DSN will be constructed that uses the correct
port AND does not use a unix socket (the 127.0.0.1 guards against that).