Merge 'trunk' into 'replication_dedux'
John Napiorkowski [Thu, 5 Jun 2008 14:28:00 +0000 (14:28 +0000)]
r13636@dev (orig r4470):  blblack | 2008-06-05 01:57:09 -0500
_verify_pid mods _dbh, so we must call it again here
r13637@dev (orig r4471):  blblack | 2008-06-05 02:21:42 -0500
remove a line from the threads test that had the potential to mask bugs, and copy it to a new "threadtxn" test too, which uses a txn_do in each thread to do the same stuff

1  2 
lib/DBIx/Class/Storage/DBI.pm

@@@ -600,7 -600,7 +600,7 @@@ sub dbh_do 
  
    eval {
      $self->_verify_pid if $dbh;
-     if( !$dbh ) {
+     if(!$self->_dbh) {
          $self->_populate_dbh;
          $dbh = $self->_dbh;
      }
@@@ -1063,7 -1063,6 +1063,7 @@@ sub _query_start 
  
      if ( $self->debug ) {
          @bind = $self->_fix_bind_params(@bind);
 +        
          $self->debugobj->query_start( $sql, @bind );
      }
  }
@@@ -1296,16 -1295,6 +1296,16 @@@ sub select_single 
    return @row;
  }
  
 +sub reload_row {
 +      my ($self, $row) = @_;
 +      
 +    my $reload = $row->result_source->resultset->find(
 +        map { $row->$_ } $row->primary_columns
 +    );
 +    
 +    return $reload;
 +}
 +
  =head2 sth
  
  =over 4
@@@ -1731,31 -1720,6 +1731,31 @@@ sub build_datetime_parser 
      }
  }
  
 +=head2 is_replicating
 +
 +A boolean that reports if a particular L<DBIx::Class::Storage::DBI> is set to
 +replicate from a master database.  Default is undef, which is the result
 +returned by databases that don't support replication.
 +
 +=cut
 +
 +sub is_replicating {
 +    return;
 +    
 +}
 +
 +=head2 lag_behind_master
 +
 +Returns a number that represents a certain amount of lag behind a master db
 +when a given storage is replicating.  The number is database dependent, but
 +starts at zero and increases with the amount of lag. Default in undef
 +
 +=cut
 +
 +sub lag_behind_master {
 +    return;
 +}
 +
  sub DESTROY {
    my $self = shift;
    return if !$self->_dbh;