Author: spadkins
Date: Wed Mar 31 18:58:22 2010
New Revision: 13879

Modified:
   p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm

Log:
clean up the dbi_post_connect_stmt option to print only if debug_sql set

Modified: p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm (original)
+++ p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm Wed Mar 31 18:58:22 2010
@@ -183,16 +183,16 @@
 
         eval {
             my $dbh = DBI->connect($dsn, $self->{dbuser}, $self->{dbpass}, 
$attr);
+            $self->{dbh} = $dbh;
             if ($self->{dbi_post_connect_stmt}) {
-                #my $debug_sql = $self->{context}{options}{debug_sql};
+                my $debug_sql = $self->{context}{options}{debug_sql};
                 my $stmts = $self->{dbi_post_connect_stmt};
                 $stmts =~ s/;$//;
                 foreach my $stmt (split(/\s*;\s*/, $stmts)) {
                     $dbh->do($stmt);
-                    print $App::DEBUG_FILE "DEBUG_SQL: $stmt [$DBI::errstr]\n";
+                    print $App::DEBUG_FILE "DEBUG_SQL: $stmt [$DBI::errstr]\n" 
if ($debug_sql);
                 }
             }
-            $self->{dbh} = $dbh;
         };
         if (my $e = $@) {
             if ($self->is_retryable_connection_error($e)) {
@@ -863,7 +863,7 @@
         if ($dbexpr =~ s/^=//) {
             # do nothing
         }
-        elsif ($dbexpr =~ /{/) { #SEB
+        elsif ($dbexpr =~ /{/) {
             $dbexpr = $self->substitute($dbexpr, $params);
         }
 
@@ -2877,7 +2877,7 @@
        
https://rt.cpan.org/Ticket/Attachment/167152/53763/dbd-mysql-multi-statements.patch
        This supports the "SCALAR" return type (and maybe "LIST" and "ROW"), but
        a stored procedure can still not return multiple rows ("ROWS"). (I 
think.)
-       You DSN needs to have "mysql_multi_results=1" set to activate the 
ability to
+       Your DSN needs to have "mysql_multi_results=1" set to activate the 
ability to
        get rows back from a stored procedure.
 
     $rep->call_procedure("call sp_doit('prod',5)");

Reply via email to