cvsuser     03/10/08 07:54:57

  Modified:    App-Repository/lib/App/Repository DBI.pm
  Log:
  remove ShowErrorStatement, reduce verbosit on trace (require_tables)
  
  Revision  Changes    Path
  1.12      +37 -31    p5ee/App-Repository/lib/App/Repository/DBI.pm
  
  Index: DBI.pm
  ===================================================================
  RCS file: /cvs/public/p5ee/App-Repository/lib/App/Repository/DBI.pm,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -w -r1.11 -r1.12
  --- DBI.pm    27 Jun 2003 18:39:37 -0000      1.11
  +++ DBI.pm    8 Oct 2003 14:54:57 -0000       1.12
  @@ -1,13 +1,13 @@
   
   ######################################################################
  -## File: $Id: DBI.pm,v 1.11 2003/06/27 18:39:37 spadkins Exp $
  +## File: $Id: DBI.pm,v 1.12 2003/10/08 14:54:57 spadkins Exp $
   ######################################################################
   
   use App;
   use App::Repository;
   
   package App::Repository::DBI;
  -$VERSION = do { my @r=(q$Revision: 1.11 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r};
  +$VERSION = do { my @r=(q$Revision: 1.12 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r};
   
   @ISA = ( "App::Repository" );
   
  @@ -212,7 +212,7 @@
           PrintError         => 0,
           AutoCommit         => 1,
           RaiseError         => 1,
  -        ShowErrorStatement => 1,
  +        #ShowErrorStatement => 1,  # this doesn't seem to include the right SQL 
statement. very confusing.
       };
       &App::sub_exit($attr) if ($App::trace_subs);
       return($attr);
  @@ -497,6 +497,7 @@
       );
   
       $where = "";
  +    $params = {} if (!$params);
       my $param_order = $params->{"_order"};
       if (!defined $param_order && ref($params) eq "HASH") {
           $param_order = [ (keys %$params) ];
  @@ -1174,7 +1175,7 @@
   }
   
   sub _require_tables {
  -    &App::sub_entry if ($App::trace_subs);
  +    &App::sub_entry if ($App::trace_subs >= 3);
      my ($self, $dbexpr, $reqd_tables, $tablealiashref, $require_type) = @_;
      #print "_require_tables($dbexpr,...,...,$require_type)\n";
      my ($tablealias, $tablealias2, @tablealias, %tableseen, $dependencies);
  @@ -1197,7 +1198,7 @@
            }
         }
      }
  -    &App::sub_exit() if ($App::trace_subs);
  +    &App::sub_exit() if ($App::trace_subs >= 3);
   }
   
   # $insert_sql = $rep->_mk_insert_row_sql ($table, [EMAIL PROTECTED], [EMAIL 
PROTECTED]);
  @@ -1443,10 +1444,15 @@
   
       my ($colidx, $col, $value, $quoted);
       if (!defined $params) {
  +        if ($cols && $row) {
           $params = $self->{table}{$table}{primary_key};
           die "_mk_delete_sql() can't delete with undef params because 
{table}{$table}{primary_key} not defined"
               if (!defined $params);
           $params = [ $params ] if (!ref($params));
  +        }
  +        else {
  +            $params = {};
  +        }
       }
   
       if (!ref($params)) {  # delete by key!
  
  
  

Reply via email to