test replication test fail
[dbsrgits/DBIx-Class.git] / t / 72pg.t
index 738a5ff..d676812 100644 (file)
--- a/t/72pg.t
+++ b/t/72pg.t
@@ -146,7 +146,7 @@ for my $use_insert_returning ($test_server_supports_insert_returning
 
   }
   SKIP: {
-    skip "Need DBD::Pg 2.9.2 or newer for array tests", 5 if $DBD::Pg::VERSION < 2.009002;
+    skip "Need DBD::Pg 2.9.2 or newer for array tests", 4 if $DBD::Pg::VERSION < 2.009002;
 
     lives_ok {
       $schema->resultset('ArrayTest')->create({
@@ -160,14 +160,8 @@ for my $use_insert_returning ($test_server_supports_insert_returning
       });
     } 'updating arrayref as pg array data';
 
-    lives_ok {
-      my $row = $schema->resultset('ArrayTest')->next;
-      $row->arrayfield ([5, 6]);
-      $row->update;
-    } 'updating dirty arrayref as pg array data';
-
     $schema->resultset('ArrayTest')->create({
-      arrayfield => [7, 8],
+      arrayfield => [5, 6],
     });
 
     my $count;
@@ -207,6 +201,15 @@ for my $use_insert_returning ($test_server_supports_insert_returning
   is( $uc_name_info->{size}, 3, "Case insensitive matching info for 'uc_name'" );
 
 
+## Test ResultSet->update
+my $artist = $schema->resultset('Artist')->first;
+my $cds = $artist->cds_unordered->search({
+    year => { '!=' => 2010 }
+}, { prefetch => 'liner_notes' });
+TODO: {
+    todo_skip 'update resultset with a prefetch over a might_have rel', 1;
+    $cds->update({ year => '2010' });
+}
 
 
 ## Test SELECT ... FOR UPDATE
@@ -244,12 +247,15 @@ for my $use_insert_returning ($test_server_supports_insert_returning
         $schema2->source("Artist")->name("dbic_t_schema.artist");
 
         $schema->txn_do( sub {
-          my $artist = $schema->resultset('Artist')->search(
+          my $rs = $schema->resultset('Artist')->search(
               {
                   artistid => 1
               },
               $t->{update_lock} ? { for => 'update' } : {}
-          )->first;
+          );
+          ok ($rs->count, 'Count works');
+
+          my $artist = $rs->next;
           is($artist->artistid, 1, "select returns artistid = 1");
 
           $timed_out = 0;
@@ -268,11 +274,6 @@ for my $use_insert_returning ($test_server_supports_insert_returning
       }
   }
 
-  # make sure subqueried count still works
-  lives_ok ( sub {
-
-  }, 'for does not propagate on count subqueries');
-
 
 ######## other older Auto-pk tests