Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the AnyEvent-DBI-MySQL CPAN distribution.

Report information
The Basics
Id: 88907
Status: resolved
Priority: 0/
Queue: AnyEvent-DBI-MySQL

People
Owner: POWERMAN [...] cpan.org
Requestors: avkhozov [...] googlemail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.0.4



Subject: Superfluous warnings
Date: Mon, 23 Sep 2013 20:37:05 +0600
To: bug-AnyEvent-DBI-MySQL [...] rt.cpan.org
From: Andrey Khozov <avkhozov [...] googlemail.com>
Hi! Code: my $cache = $dbh->{Driver}{CachedKids}; for (grep {$cache->{$_} == $dbh} keys %{$cache}) { weaken($cache->{$_}); } generate warning ( Use of uninitialized value in numeric eq (==) ) ​if $dbh was undefined​ and some handles exists in $cache. -- Andrey Khozov
On Mon Sep 23 10:37:39 2013, avkhozov@googlemail.com wrote: Show quoted text
> Hi! > > Code: > > > my $cache = $dbh->{Driver}{CachedKids}; > for (grep {$cache->{$_} == $dbh} keys %{$cache}) { > weaken($cache->{$_}); > } > > generate warning ( Use of uninitialized value in numeric eq (==) ) ​if $dbh > was undefined​ and some handles exists in $cache. > > >
A minimal script for demonstration this error: === #!/usr/bin/env perl use strict; use warnings; use AnyEvent::DBI::MySQL (); my ($db1, $db2, $db3); eval { $db1 = AnyEvent::DBI::MySQL->connect('dbi:mysql:host=db1;port=3306;database=db', 'user', 'pass'); }; eval { $db2 = AnyEvent::DBI::MySQL->connect('dbi:mysql:host=db2;port=3306;database=db', 'user', 'pass'); }; # this db not worked! eval { $db3 = AnyEvent::DBI::MySQL->connect('dbi:mysql:host=db1;port=3306;database=db', 'user', 'pass'); }; === Could I send a patch that will fix this bug?
Subject: Re: [rt.cpan.org #88907] Superfluous warnings
Date: Thu, 31 Oct 2013 19:08:45 +0200
To: Andrey Khozov via RT <bug-AnyEvent-DBI-MySQL [...] rt.cpan.org>
From: Alex Efros <powerman [...] powerman.name>
Hi! On Thu, Oct 31, 2013 at 08:21:24AM -0400, Andrey Khozov via RT wrote: Show quoted text
> A minimal script for demonstration this error:
I've modified it to use 'localhost' with right/wrong ports and this script also didn't output any warnings on my system. But then I realized it uses UNIX socket to connect to MySQL server, so I've replaced 'localhost' with '127.0.0.1' to force it to use TCP instead, and now I see issue you're talking about… But it's not just a superfluous warning, there is also a bug (which you're working around using eval) - on failed connect({RaiseError=>0}) it should return undef instead of throwing exception (just like DBI->connect() do). Fixed in 1.0.4. Thanks for the report! P.S. Please check is these changes also fix superfluous warning which you've reported several weeks ago. -- WBR, Alex.
On Thu Oct 31 13:09:01 2013, powerman@powerman.name wrote: Show quoted text
> Hi! > > On Thu, Oct 31, 2013 at 08:21:24AM -0400, Andrey Khozov via RT wrote:
> > A minimal script for demonstration this error:
> > I've modified it to use 'localhost' with right/wrong ports and this script > also didn't output any warnings on my system. > > But then I realized it uses UNIX socket to connect to MySQL server, so > I've replaced 'localhost' with '127.0.0.1' to force it to use TCP instead, > and now I see issue you're talking about… But it's not just a superfluous > warning, there is also a bug (which you're working around using eval) - on > failed connect({RaiseError=>0}) it should return undef instead of throwing > exception (just like DBI->connect() do). > > Fixed in 1.0.4. > > Thanks for the report! > > > P.S. Please check is these changes also fix superfluous warning which > you've reported several weeks ago. >
Hi! Thanks for this fix! I'll watch the rest of the warnings.