Author: timbo
Date: Sun Feb  6 04:42:29 2011
New Revision: 14685

Modified:
   dbi/trunk/Changes
   dbi/trunk/DBI.pm

Log:
Fix references to DBI::dbi_debug to mask off the flag bits.
Add note to Changes


Modified: dbi/trunk/Changes
==============================================================================
--- dbi/trunk/Changes   (original)
+++ dbi/trunk/Changes   Sun Feb  6 04:42:29 2011
@@ -12,7 +12,8 @@
     people doing DBI->{Attrib}.
   Fixed the definition of ArrayTupleStatus and remove confusion over
     rows affected in list context of execute_array (Martin J. Evans)
-  Added CON, ENC and DBD trace flags (MArtin J. Evans)
+  Added CON, ENC and DBD trace flags (Martin J. Evans)
+  Enhanced and standardized driver trace level mechanism (Tim Bunce)
 
 =head2 Changes in DBI 1.616 (svn r14616) 30th December 2010
 

Modified: dbi/trunk/DBI.pm
==============================================================================
--- dbi/trunk/DBI.pm    (original)
+++ dbi/trunk/DBI.pm    Sun Feb  6 04:42:29 2011
@@ -245,7 +245,7 @@
    ) ], # notionally "in" DBI::Profile and normally imported from there
 );
 
-$DBI::dbi_debug = 0;
+$DBI::dbi_debug = 0;          # mixture of bit fields and int sub-fields
 $DBI::neat_maxlen = 1000;
 $DBI::stderr = 2_000_000_000; # a very round number below 2**31
 
@@ -488,7 +488,7 @@
     my $ima_trace = 0+($ENV{DBI_IMA_TRACE}||0);
     while ( my ($method, $info) = each %$meths ) {
        my $fullmeth = "DBI::${class}::$method";
-       if ($DBI::dbi_debug >= 15) { # quick hack to list DBI methods
+       if (($DBI::dbi_debug & 0xF) == 15) { # quick hack to list DBI methods
            # and optionally filter by IMA flags
            my $O = $info->{O}||0;
            printf "0x%04x %-20s\n", $O, $fullmeth
@@ -719,7 +719,7 @@
         # and finished the attribute setup. pass in the original arguments
        $dbh->connected(@orig_args); #if ref $dbh ne 'DBI::db' or $proxy;
 
-       DBI->trace_msg("    <- connect= $dbh\n") if $DBI::dbi_debug;
+       DBI->trace_msg("    <- connect= $dbh\n") if $DBI::dbi_debug & 0xF;
 
        return $dbh;
     };
@@ -763,7 +763,7 @@
 
     $class->trace_msg("    -> $class->install_driver($driver"
                        .") for $^O perl=$] pid=$$ ruid=$< euid=$>\n")
-       if $DBI::dbi_debug;
+       if $DBI::dbi_debug & 0xF;
 
     # --- load the code
     my $driver_class = "DBD::$driver";
@@ -793,7 +793,7 @@
        }
        Carp::croak("install_driver($driver) failed: $err$advice\n");
     }
-    if ($DBI::dbi_debug) {
+    if ($DBI::dbi_debug & 0xF) {
        no strict 'refs';
        (my $driver_file = $driver_class) =~ s/::/\//g;
        my $dbd_ver = ${"$driver_class\::VERSION"} || "undef";
@@ -816,7 +816,7 @@
     }
 
     $DBI::installed_drh{$driver} = $drh;
-    $class->trace_msg("    <- install_driver= $drh\n") if $DBI::dbi_debug;
+    $class->trace_msg("    <- install_driver= $drh\n") if $DBI::dbi_debug & 
0xF;
     $drh;
 }
 
@@ -1475,7 +1475,7 @@
        };
        my $dbh = $cache->{$key};
         $drh->trace_msg(sprintf("    connect_cached: key '$key', cached dbh 
$dbh\n", DBI::neat($key), DBI::neat($dbh)))
-            if $DBI::dbi_debug >= 4;
+            if (($DBI::dbi_debug & 0xF) >= 4);
 
         my $cb = $attr->{Callbacks}; # take care not to autovivify
        if ($dbh && $dbh->FETCH('Active') && eval { $dbh->ping }) {

Reply via email to