Bug #27521 Makefile.PL --testport option does not work without --testhost
Submitted: 29 Mar 2007 12:39 Modified: 20 Feb 2013 22:48
Reporter: Philip Stoev Email Updates:
Status: Unsupported Impact on me:
None 
Category:Connectors: DBD::mysql ( Perl ) Severity:S3 (Non-critical)
Version:4.004 OS:Linux (Linux)
Assigned to: CPU Architecture:Any
Tags: qc

[29 Mar 2007 12:39] Philip Stoev
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).
[29 Mar 2007 18:38] Valeriy Kravchuk
Thank you for a bug report. Verified just as described.
[20 Feb 2013 22:48] Sveta Smirnova
Thank you for the report.

We don't work on DBD::mysql bugs anymore. All its bugs should go to CPAN: https://rt.cpan.org/Public/Dist/Display.html?Name=DBD-mysql

I re-submitted your report to https://rt.cpan.org/Public/Bug/Display.html?id=83496
Please subscribe to the new report on CPAN and work with DBD::mysql developers in case if they need additional details.