fix and regression test for RT #62642
John Napiorkowski [Wed, 10 Nov 2010 02:22:58 +0000 (21:22 -0500)]
Changes
lib/DBIx/Class/Storage/DBI/Replicated.pm
t/storage/replicated.t

diff --git a/Changes b/Changes
index 02680cf..c21bc0b 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 Revision history for DBIx::Class
 
+    * Fixes
+        - Fixed read-only attribute set attempt in ::Storage::Replicated
+          (RT#62642)
+
 0.08124 2010-10-28 14:23 (UTC)
     * New Features / Changes
         - Add new -ident "function" indicating rhs is a column name
index 967d0e0..4477475 100644 (file)
@@ -430,8 +430,9 @@ around connect_info => sub {
       $merge->merge((delete $opts{pool_args} || {}), $self->pool_args)
     );
 
-    $self->pool($self->_build_pool)
-      if $self->pool;
+    ## Since we possibly changed the pool_args, we need to clear the current
+    ## pool object so that next time it is used it will be rebuilt.
+    $self->clear_pool;
   }
 
   if (@opts{qw/balancer_type balancer_args/}) {
index 40342ea..38ddcb1 100644 (file)
@@ -89,7 +89,7 @@ TESTSCHEMACLASSES: {
             balancer_type=>'::Random',
             balancer_args=>{
               auto_validate_every=>100,
-          master_read_weight => 1
+              master_read_weight => 1
             },
           }
         },
@@ -105,8 +105,11 @@ TESTSCHEMACLASSES: {
         storage_type=> '::DBI::Replicated',
         balancer_type=>'::Random',
         balancer_args=> {
-          auto_validate_every=>100,
-      master_read_weight => 1
+            auto_validate_every=>100,
+            master_read_weight => 1
+        },
+        pool_args=>{
+            maximum_lag=>1,
         },
         deploy_args=>{
           add_drop_table => 1,