Skip Menu |
 

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

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

People
Owner: CAPTTOFU [...] cpan.org
Requestors: MARKLE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 4.011
Fixed in: (no value)



Subject: t/40blobs.t cannot pass without database access - ServerError() not declared
Download (untitled) / with headers
text/plain 590b
t/40blobs.t causes test failure when the test script cannot access a live database. t/40blobs.t ................. Can't call method "get_info" on an undefined value at t/40blobs.t line 37. t/40blobs.t ................. Dubious, test returned 2 (wstat 512, 0x200) No subtests run This is because the eval {} block says to get a $dbh or call ServerError(), but ServerError() is not defined, so this fails. Then it proceeds to call a method on $dbh, which is still undefined. t/40bindparam2.t does the same thing but it does not fail because it checks $@ first and then decides to skip.
From: sthoenna [...] efn.org
Download (untitled) / with headers
text/plain 261b
On Thu Apr 30 19:20:13 2009, MARKLE wrote: Show quoted text
> t/40blobs.t causes test failure when the test script cannot access a > live database. > > t/40blobs.t ................. Can't call method "get_info" on an > undefined value at t/40blobs.t line 37.
Patch attached.
--- DBD-mysql-4.012/t/40blobs.t.orig 2009-07-12 13:34:35.000000000 -0700 +++ DBD-mysql-4.012/t/40blobs.t 2009-07-12 13:35:52.000000000 -0700 @@ -29,20 +29,20 @@ } my $dbh; -my $charset= 'DEFAULT CHARSET=utf8'; eval {$dbh = DBI->connect($test_dsn, $test_user, $test_password, { RaiseError => 1, AutoCommit => 1}) or ServerError() ;}; -if ($dbh->get_info($GetInfoType{SQL_DBMS_VER}) lt "4.1") { - $charset= ''; -} - if ($@) { plan skip_all => "ERROR: $DBI::errstr. Can't continue test"; } plan tests => 14; +my $charset= 'DEFAULT CHARSET=utf8'; +if ($dbh->get_info($GetInfoType{SQL_DBMS_VER}) lt "4.1") { + $charset= ''; +} + my $size= 128; ok $dbh->do("DROP TABLE IF EXISTS $table"), "Drop table if exists $table";
Download (untitled) / with headers
text/plain 122b
Tested the patch, and found that it fixes the problem. $ perl -v This is perl, v5.10.0 built for i386-linux-thread-multi
Download (untitled) / with headers
text/plain 123b
Hi there - thanks for the patch! I'll be rolling out a release this week that will include this. Thank you again, Patrick
Thanks! going in 4.013 this week.
Download (untitled) / with headers
text/plain 387b
On Wed Sep 16 12:29:13 2009, CAPTTOFU wrote: Show quoted text
> Thanks! going in 4.013 this week.
This patch fails on DBD-mysql-4.014.tar.gz / DBI 1.609: t/40blobs.t ................. Can't call method "get_info" on an undefined value at t/40blobs.t line 37. t/40blobs.t ................. Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run calling ->get_info() needs to be in an eval()
Download (untitled) / with headers
text/plain 569b
On Sun Apr 18 15:02:04 2010, AVAR wrote: Show quoted text
> On Wed Sep 16 12:29:13 2009, CAPTTOFU wrote:
> > Thanks! going in 4.013 this week.
> > This patch fails on DBD-mysql-4.014.tar.gz / DBI 1.609: > > t/40blobs.t ................. Can't call method "get_info" on an > undefined value at t/40blobs.t line 37. > t/40blobs.t ................. Dubious, test returned 255 (wstat 65280, > 0xff00) > No subtests run > > calling ->get_info() needs to be in an eval()
This isn't the patch failing, this is the patch, which was in 4.013, having been reverted for 4.014. Accidentally?
Download (untitled) / with headers
text/plain 814b
On Mon Jun 07 15:20:11 2010, http://ysth.livejournal.com/ wrote: Show quoted text
> On Sun Apr 18 15:02:04 2010, AVAR wrote:
> > On Wed Sep 16 12:29:13 2009, CAPTTOFU wrote:
> > > Thanks! going in 4.013 this week.
> > > > This patch fails on DBD-mysql-4.014.tar.gz / DBI 1.609: > > > > t/40blobs.t ................. Can't call method "get_info" on an > > undefined value at t/40blobs.t line 37. > > t/40blobs.t ................. Dubious, test returned 255 (wstat
65280, Show quoted text
> > 0xff00) > > No subtests run > > > > calling ->get_info() needs to be in an eval()
> > This isn't the patch failing, this is the patch, which was in 4.013, > having been reverted for 4.014. Accidentally?
Maybe it's a separate bug, but I still get " Can't call method "get_info" on an undefined value at t/40blobs.t line 37." on 5.13.1 and 5.13.2.
Download (untitled) / with headers
text/plain 1.4k
On Wed Jun 23 06:37:45 2010, AVAR wrote: Show quoted text
> On Mon Jun 07 15:20:11 2010, http://ysth.livejournal.com/ wrote:
> > On Sun Apr 18 15:02:04 2010, AVAR wrote:
> > > On Wed Sep 16 12:29:13 2009, CAPTTOFU wrote:
> > > > Thanks! going in 4.013 this week.
> > > > > > This patch fails on DBD-mysql-4.014.tar.gz / DBI 1.609: > > > > > > t/40blobs.t ................. Can't call method "get_info" on an > > > undefined value at t/40blobs.t line 37. > > > t/40blobs.t ................. Dubious, test returned 255 (wstat
> 65280,
> > > 0xff00) > > > No subtests run > > > > > > calling ->get_info() needs to be in an eval()
> > > > This isn't the patch failing, this is the patch, which was in 4.013, > > having been reverted for 4.014. Accidentally?
> > Maybe it's a separate bug, but I still get " Can't call method > "get_info" on an undefined value at t/40blobs.t line 37." on 5.13.1 and > 5.13.2.
Looks like the same bug, fails here too: eval {$dbh = DBI->connect($test_dsn, $test_user, $test_password, { RaiseError => 1, AutoCommit => 1}) or ServerError() }; if ($dbh->get_info($GetInfoType{SQL_DBMS_VER}) lt "4.1") { $charset= ''; } if ($@) { plan skip_all => "ERROR: $DBI::errstr. Can't continue test"; } ^^ There is no way the above will execute without $test_* being set, as $dbh will be undef and will die on the $dbh->get_info line.
Download (untitled) / with headers
text/plain 1.9k
On Thu Jul 08 12:05:36 2010, RIBASUSHI wrote: Show quoted text
> On Wed Jun 23 06:37:45 2010, AVAR wrote:
> > On Mon Jun 07 15:20:11 2010, http://ysth.livejournal.com/ wrote:
> > > On Sun Apr 18 15:02:04 2010, AVAR wrote:
> > > > On Wed Sep 16 12:29:13 2009, CAPTTOFU wrote:
> > > > > Thanks! going in 4.013 this week.
> > > > > > > > This patch fails on DBD-mysql-4.014.tar.gz / DBI 1.609: > > > > > > > > t/40blobs.t ................. Can't call method "get_info" on an > > > > undefined value at t/40blobs.t line 37. > > > > t/40blobs.t ................. Dubious, test returned 255 (wstat
> > 65280,
> > > > 0xff00) > > > > No subtests run > > > > > > > > calling ->get_info() needs to be in an eval()
> > > > > > This isn't the patch failing, this is the patch, which was in 4.013, > > > having been reverted for 4.014. Accidentally?
> > > > Maybe it's a separate bug, but I still get " Can't call method > > "get_info" on an undefined value at t/40blobs.t line 37." on 5.13.1 and > > 5.13.2.
> > Looks like the same bug, fails here too: > > eval {$dbh = DBI->connect($test_dsn, $test_user, $test_password, { > RaiseError => 1, AutoCommit => 1}) or ServerError() }; > > if ($dbh->get_info($GetInfoType{SQL_DBMS_VER}) lt "4.1") { > $charset= ''; > } > > if ($@) { > plan skip_all => "ERROR: $DBI::errstr. Can't continue test"; > } > > > ^^ There is no way the above will execute without $test_* being set, as > $dbh will be undef and will die on the $dbh->get_info line.
Hi there! Does this still fail for you on 4.6 ? I test by shutting down mysql and running the test suite: t/40blobs...................skipped all skipped: ERROR: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2). Can't continue test Please let me know if this is what you get and if not, let me know how to reproduce. Thanks!
Download (untitled) / with headers
text/plain 175b
resolving this bug. I cannot get it to manifest. If someone can and wants to re-open this bug, please provide me exact reproduction steps-- even a virtual machine if possible.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.