Subject: | DBD-mysql 4.029 can no longer be tested against a remote database |
For years (literally, well over a decade) I have been building DBD-mysql on multiple platforms for multiple perl compilers, and always used a centrally managed testdb that I set up and maintain for precisely this purpose. I have been doing this for all of the DBD::* drivers I build and support: you configure a test resource and then configure each build to use it. I've been doing this for MySQL, Sybase, Oracle, DB2, etc.
The latest release (4.029) includes a change that has broken this:
* Added fix to tests to create test database if not exists (contstant failure on Travis) (CaptTofu)
This is implemented in t/05dbcreate.t, and it attempts to connect to the database WITHOUT using the auto-generated $test_dsn variable, like almost all of the other uses of DBI->connect throughout the test suite. This assumes that the database is on the localhost, and as a result, the entire test suite bails because it can't connect.
The attached patch simply makes 05dbcreate.t use $test_dsn, and fixes the issue.
Subject: | 05dbcreate.t.patch |
diff -rc ../DBD-mysql-4.029-orig/t/05dbcreate.t ./t/05dbcreate.t
*** ../DBD-mysql-4.029-orig/t/05dbcreate.t 2014-12-08 08:56:52.000000000 -0500
--- ./t/05dbcreate.t 2015-02-06 09:21:45.362117233 -0500
***************
*** 8,19 ****
use vars qw($mdriver);
$|= 1;
! use vars qw($test_user $test_password $test_db);
use lib 't', '.';
require 'lib.pl';
my $dbh;
! eval {$dbh= DBI->connect('DBI:mysql:information_schema', $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
# https://rt.cpan.org/Ticket/Display.html?id=31823
--- 8,19 ----
use vars qw($mdriver);
$|= 1;
! use vars qw($test_user $test_password $test_db $test_dsn);
use lib 't', '.';
require 'lib.pl';
my $dbh;
! eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
if ($@) {
# https://rt.cpan.org/Ticket/Display.html?id=31823