Skip Menu |

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 112072
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: MICHIELB [...] cpan.org
Requestors: vlmarek [...] volny.cz
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 4.033
Fixed in: 4.035_03



Subject: Some minor test fixes
a) test 05dbcreate.t does not take into account the database connection details specified to Makefile.PL b) broken detection whether we have Test::Deep in test 87async.t The patch attached solves both issues. Thank you __ Vlad
Subject: 00_test05.patch
--- DBD-mysql-4.033/t/05dbcreate.t 2016-02-13 13:29:56.467130717 -0800 +++ DBD-mysql-4.033/t/05dbcreate.t 2016-02-13 13:23:45.371688976 -0800 @@ -10,7 +10,7 @@ use lib 't', '.'; require 'lib.pl'; my $dbh; -eval {$dbh= DBI->connect('DBI:mysql:', $test_user, $test_password, +eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password, { RaiseError => 1, PrintError => 1, AutoCommit => 0 });}; if ($@) { diag $@; --- DBD-mysql-4.033/t/87async.t 2016-02-13 13:37:19.948093572 -0800 +++ DBD-mysql-4.033/t/87async.t 2016-02-13 13:36:58.066381499 -0800 @@ -1,7 +1,6 @@ use strict; use warnings; -use Test::Deep; use Test::More; use DBI; use DBI::Const::GetInfoType; @@ -11,10 +10,10 @@ use vars qw($test_dsn $test_user $test_p use lib 't', '.'; require 'lib.pl'; -eval { use Test::Deep }; -SKIP: { - if ($!) { - skip "Test::Deep is not installed!"; +BEGIN { + eval { require Test::Deep }; + if ($@) { + plan skip_all => 'Test::Deep is not installed!'; } } my $dbh;
Subject: Re: [rt.cpan.org #112072] Some minor test fixes
Date: Tue, 16 Feb 2016 09:52:30 +0100
To: "bug-DBD-mysql [...] rt.cpan.org" <bug-DBD-mysql [...] rt.cpan.org>
From: Michiel Beijen <michiel.beijen [...] gmail.com>
Thanks! On Tue, Feb 16, 2016 at 9:41 AM, Vladimir Marek via RT <bug-DBD-mysql@rt.cpan.org> wrote: Show quoted text
> Tue Feb 16 03:41:58 2016: Request 112072 was acted upon. > Transaction: Ticket created by neuron > Queue: DBD-mysql > Subject: Some minor test fixes > Broken in: 4.033 > Severity: (no value) > Owner: Nobody > Requestors: vlmarek@volny.cz > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=112072 > > > > a) test 05dbcreate.t does not take into account the database connection details specified to Makefile.PL > > > b) broken detection whether we have Test::Deep in test 87async.t > > The patch attached solves both issues. > > Thank you > __ > Vlad
On Tue 16 Feb 2016 03:41:58, neuron wrote: Show quoted text
> a) test 05dbcreate.t does not take into account the database > connection details specified to Makefile.PL
well, it's not really a TEST, you see? It actually CREATES a database for you which is why the test needs to connect to the database without specifying the database name. But I see how this currently would not work if the test database is a remote database. Do you see my point and can you please modify the patch? -- Michiel
From: vlmarek [...] volny.cz
Hi, Show quoted text
> well, it's not really a TEST, you see? It actually CREATES a database > for you which is why the test needs to connect to the database without > specifying the database name.
Oh, I see now. That didn't occur to me. Show quoted text
> But I see how this currently would not work if the test database is a > remote database.
In fact I'm using --testsocket=blah opion and not connecting via TCP. Show quoted text
> Do you see my point and can you please modify the patch?
I see your point, but I'm not sure how to fix it properly. Should there be some clever regex to remove the database name from the DSN? Or rather it should detect that $test_dsn contains eiter of host=, port=, mysql_socket= option and add it to the current 'DBI:mysql:'? The later seems to be more straight forward ... Thank you __ Vlad
On Tue Feb 16 03:41:58 2016, neuron wrote: Show quoted text
> b) broken detection whether we have Test::Deep in test 87async.t
Hi Vladimir, You're right, this detection does not work - nor has it ever worked if I read git history correctly. I just removed the detection as Test::Deep is specified as a dependency in Makefile.PL. Ref: https://github.com/perl5-dbi/DBD-mysql/commit/235fbd38f5635a60b0cfd38819704d51d1dd42dd
On Mon 29 Feb 2016 17:22:08, neuron wrote: Show quoted text
> In fact I'm using --testsocket=blah opion and not connecting via TCP. > >
> > Do you see my point and can you please modify the patch?
> > I see your point, but I'm not sure how to fix it properly. Should > there be some clever regex to remove the database name from the DSN? > Or rather it should detect that $test_dsn contains eiter of host=, > port=, mysql_socket= option and add it to the current 'DBI:mysql:'? > The later seems to be more straight forward ...
I added the clever regex: https://github.com/perl5-dbi/DBD-mysql/commit/138d73f719774b5eefd2bfd4000aaaecbaf45822 It's now a dev release on CPAN: 4.035_03. It will be 4.036 (stable release) this week, if everything is OK. Thanks for your contribution! -- Michiel