Philip M. Gollucci wrote:
>> 2 possible avenues to investigate:
>>  - Look at changing Apache::DBI to not use the ref as part of the dsn
>> cache key, but use the contents of the array
>>    something along the lines of :
>>     $Key = Dumper([EMAIL PROTECTED]);
> 
> 
> If you do patch Apache::DBI, please post the diff, maybe we could add an
> httpd.conf PerlSetVar to enable/disable your new behavior ?

Possible patch to DBI to correct this behavior (untested).

--- DBI.pm.orig 2005-11-23 13:54:15.000000000 -0800
+++ DBI.pm      2005-11-23 14:00:07.000000000 -0800
@@ -89,19 +89,11 @@
     my $dsn    = "dbi:$drh->{Name}:$args[0]";
     my $prefix = "$$ Apache::DBI            ";

-    my $Idx = join $;, $args[0], $args[1], $args[2]; # key of %Connected and 
%Rollback.
-
-    # the hash-reference differs between calls even in the same
-    # process, so de-reference the hash-reference
-    if (3 == $#args and ref $args[3] eq "HASH") {
-      # should we default to '__undef__' or something for undef values?
-      map { $Idx .= "$;$_=" .
-             (defined $args[3]->{$_}
-              ? $args[3]->{$_}
-              : '')
-           } sort keys %{$args[3]};
-    } elsif (3 == $#args) {
-        pop @args;
+    my $Idx;
+    {
+        local $Data::Dumper::Indent = 0;
+        local $Data::Dumper::Terse = 1;
+        $Idx = Dumper([EMAIL PROTECTED]);
     }

     # don't cache connections created during server initialization; they
@@ -292,7 +284,8 @@
         my($r, $q) = @_;
         my(@s) = qw(<TABLE><TR><TD>Datasource</TD><TD>Username</TD></TR>);
         for (keys %Connected) {
-            push @s, '<TR><TD>', join('</TD><TD>', (split($;, $_))[0,1]), 
"</TD></TR>\n";
+            my @data = @{ eval $_ }
+            push @s, '<TR><TD>', join('</TD><TD>', @data[0,1], "</TD></TR>\n";
         }
         push @s, '</TABLE>';
         return [EMAIL PROTECTED];
@@ -306,7 +299,8 @@
         my($r, $q) = @_;
         my(@s) = qw(<TABLE><TR><TD>Datasource</TD><TD>Username</TD></TR>);
         for (keys %Connected) {
-            push @s, '<TR><TD>', join('</TD><TD>', (split($;, $_))[0,1]), 
"</TD></TR>\n";
+            my @data = @{ eval $_ }
+            push @s, '<TR><TD>', join('</TD><TD>', @data[0,1], "</TD></TR>\n";
         }
         push @s, '</TABLE>';
         return [EMAIL PROTECTED];

--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to