Merge 'trunk' into 'DBIx-Class-current'
Matt S Trout [Sat, 20 May 2006 00:34:58 +0000 (00:34 +0000)]
r8698@cain (orig r1666):  tomk | 2006-05-18 15:56:54 +0000
Moved UUIDColumns.pm over from main DBIx::Class dist

r8699@cain (orig r1667):  tomk | 2006-05-18 15:59:52 +0000
Moved UUIDMaker.pm over from main DBIx::Class dist

r8707@cain (orig r1675):  tomk | 2006-05-18 16:49:41 +0000
Undoing changes commited in revisions 1664-1671... Sorry for the fuck up
r8718@cain (orig r1681):  jguenther | 2006-05-18 18:32:06 +0000
added bind information to exception thrown from DBIx::Class::Storage::DBI::_execute()
r8731@cain (orig r1684):  jguenther | 2006-05-18 21:55:45 +0000
removed another couple extraneous $self->dbh calls
r8732@cain (orig r1685):  jguenther | 2006-05-18 22:11:20 +0000
fixed small error in the SYNOPSIS of ResultSetManager.pm
r8733@cain (orig r1686):  jguenther | 2006-05-18 22:34:31 +0000
fixed an out-of-date limitation for has_many prefetch mentioned in Cookbook.pm
r8741@cain (orig r1694):  castaway | 2006-05-19 12:42:20 +0000
Update VERSION

r8742@cain (orig r1695):  castaway | 2006-05-19 13:03:20 +0000
Oops, fix bookmark thingy here too

r8743@cain (orig r1696):  castaway | 2006-05-19 13:12:22 +0000
.. And correct the number of tests

lib/DBIx/Class.pm
lib/DBIx/Class/Manual/Cookbook.pod
lib/DBIx/Class/ResultSetManager.pm
lib/DBIx/Class/Storage/DBI.pm
t/helperrels/26sqlt.t

index 75b87d6..1ba52a0 100644 (file)
@@ -13,7 +13,7 @@ sub component_base_class { 'DBIx::Class' }
 # i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports
 # brain damage and presumably various other packaging systems too
 
-$VERSION = '0.06002';
+$VERSION = '0.06003';
 
 sub MODIFY_CODE_ATTRIBUTES {
     my ($class,$code,@attrs) = @_;
index f83d7ee..00f4c82 100644 (file)
@@ -313,9 +313,8 @@ L<DBIx::Class> has now prefetched all matching data from the C<artist> table,
 so no additional SQL statements are executed. You now have a much more
 efficient query.
 
-Note that as of L<DBIx::Class> 0.04, C<prefetch> cannot be used with
-C<has_many> relationships. You will get an error along the lines of "No
-accessor for prefetched ..." if you try.
+Note that as of L<DBIx::Class> 0.05999_01, C<prefetch> I<can> be used with
+C<has_many> relationships.
 
 Also note that C<prefetch> should only be used when you know you will
 definitely use data from a related table. Pre-fetching related tables when you
index a0911bc..f5a62b4 100644 (file)
@@ -22,7 +22,7 @@ use Class::Inspector;
     my $cond = shift;
     my $attrs = shift || {};
     $attrs->{order_by} = 'year DESC';
-    $self->next::method($cond, $attrs);
+    $self->search($cond, $attrs);
   }
 
   $rs = $schema->resultset('CD')->search_by_year_desc({ artist => 'Tool' });
index 3f3f49c..83753ac 100644 (file)
@@ -509,8 +509,8 @@ Issues a commit against the current dbh.
 
 sub txn_commit {
   my $self = shift;
+  my $dbh = $self->dbh;
   if ($self->{transaction_depth} == 0) {
-    my $dbh = $self->dbh;
     unless ($dbh->{AutoCommit}) {
       $self->debugobj->txn_commit()
         if ($self->debug);
@@ -521,7 +521,7 @@ sub txn_commit {
     if (--$self->{transaction_depth} == 0) {
       $self->debugobj->txn_commit()
         if ($self->debug);
-      $self->dbh->commit;
+      $dbh->commit;
     }
   }
 }
@@ -538,8 +538,8 @@ sub txn_rollback {
   my $self = shift;
 
   eval {
+    my $dbh = $self->dbh;
     if ($self->{transaction_depth} == 0) {
-      my $dbh = $self->dbh;
       unless ($dbh->{AutoCommit}) {
         $self->debugobj->txn_rollback()
           if ($self->debug);
@@ -550,7 +550,7 @@ sub txn_rollback {
       if (--$self->{transaction_depth} == 0) {
         $self->debugobj->txn_rollback()
           if ($self->debug);
-        $self->dbh->rollback;
+        $dbh->rollback;
       }
       else {
         die DBIx::Class::Storage::NESTED_ROLLBACK_EXCEPTION->new;
@@ -578,9 +578,10 @@ sub _execute {
   my $sth = eval { $self->sth($sql,$op) };
 
   if (!$sth || $@) {
-    $self->throw_exception('no sth generated via sql (' . ($@ || $self->_dbh->errstr) . "): $sql");
+    $self->throw_exception(
+      'no sth generated via sql (' . ($@ || $self->_dbh->errstr) . "): $sql"
+    );
   }
-
   @bind = map { ref $_ ? ''.$_ : $_ } @bind; # stringify args
   my $rv;
   if ($sth) {
index af87625..16f7013 100644 (file)
@@ -10,7 +10,7 @@ plan skip_all => 'SQL::Translator required' if $@;
 
 my $schema = DBICTest::Schema;
 
-plan tests => 33;
+plan tests => 35;
 
 my $translator           =  SQL::Translator->new( 
     parser_args          => {
@@ -83,6 +83,10 @@ my @fk_constraints =
    'selftable' => 'bookmark', 'foreigntable' => 'link', 
    'selfcols'  => ['link'], 'foreigncols' => ['id'],
    'needed' => 1, on_delete => '', on_update => ''},
+  {'display' => 'bookmark -> link',
+   'selftable' => 'bookmark', 'foreigntable' => 'link', 
+   'selfcols'  => ['link'], 'foreigncols' => ['id'],
+   'needed' => 1, on_delete => '', on_update => ''},
  );
 
 my @unique_constraints = (