Skip Menu |

This queue is for tickets about the DBI CPAN distribution.

Report information
The Basics
Id: 11260
Status: resolved
Priority: 0/
Queue: DBI

People
Owner: Nobody in particular
Requestors: stig [...] fotango.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 1.43
  • 1.46
Fixed in: (no value)



Subject: connect_cached throws warning after a clone
I noticed that under some circumstances (after a clone, for example) the $attr hashref had keys with undef values in it. In connect_cached, this would cause join to throw a warning. The attached patch kills this warning.
diff -Naur DBI-1.46.orig/DBI.pm DBI-1.46/DBI.pm --- DBI-1.46.orig/DBI.pm 2004-11-16 12:23:38.000000000 +0000 +++ DBI-1.46/DBI.pm 2005-01-27 16:32:56.000000000 +0000 @@ -1400,8 +1400,11 @@ $drh->STORE('CachedKids', $cache = {}) unless $cache; my @attr_keys = $attr ? sort keys %$attr : (); - my $key = join "~~", $dsn, $user||'', $auth||'', - $attr ? (@attr_keys,@{$attr}{@attr_keys}) : (); + my $key = do { + local $^W = 0; # don't warn about keys with undef values in $attr + join "~~", $dsn, $user||'', $auth||'', + $attr ? (@attr_keys,@{$attr}{@attr_keys}) : (); + }; my $dbh = $cache->{$key}; if ($dbh && $dbh->FETCH('Active') && eval { $dbh->ping }) { # XXX warn if BegunWork?
Thanks. Was already fixed in my current subversion codebase.