From: John Napiorkowski Date: Wed, 10 Nov 2010 02:22:58 +0000 (-0500) Subject: fix and regression test for RT #62642 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=64ae166780d0cb2b9577e506da9b9b240c146d20;p=dbsrgits%2FDBIx-Class-Historic.git fix and regression test for RT #62642 --- diff --git a/Changes b/Changes index 02680cf..c21bc0b 100644 --- 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 diff --git a/lib/DBIx/Class/Storage/DBI/Replicated.pm b/lib/DBIx/Class/Storage/DBI/Replicated.pm index 967d0e0..4477475 100644 --- a/lib/DBIx/Class/Storage/DBI/Replicated.pm +++ b/lib/DBIx/Class/Storage/DBI/Replicated.pm @@ -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/}) { diff --git a/t/storage/replicated.t b/t/storage/replicated.t index 40342ea..38ddcb1 100644 --- a/t/storage/replicated.t +++ b/t/storage/replicated.t @@ -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,