X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FReplicated.pm;h=04b94f29de555b68bea6dec8474d4276e9562b9c;hb=bf51641f97a504ae9796fcc45da4e409c6466ca4;hp=46ad46286b98971e17ffb29e4d1d7a741f8c33e3;hpb=6a247f3368100ac0557e33cc534bc8ad0ccb1175;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/Replicated.pm b/lib/DBIx/Class/Storage/DBI/Replicated.pm index 46ad462..04b94f2 100644 --- a/lib/DBIx/Class/Storage/DBI/Replicated.pm +++ b/lib/DBIx/Class/Storage/DBI/Replicated.pm @@ -314,7 +314,6 @@ has 'write_handler' => ( svp_begin svp_release relname_to_table_alias - _straight_join_to_node _dbh_last_insert_id _fix_bind_params _default_dbi_connect_attributes @@ -346,7 +345,6 @@ has 'write_handler' => ( _sqlt_minimum_version _sql_maker_opts _conn_pid - _conn_tid _dbh_autocommit _native_data_type _get_dbh @@ -357,41 +355,38 @@ has 'write_handler' => ( _resolve_column_info _prune_unused_joins _strip_cond_qualifiers - _parse_order_by _resolve_aliastypes_from_select_args _execute _do_query _dbh_sth _dbh_execute - _prefetch_insert_auto_nextvals /], ); my @unimplemented = qw( _arm_global_destructor - _preserve_foreign_dbh _verify_pid - _verify_tid get_use_dbms_capability set_use_dbms_capability get_dbms_capability set_dbms_capability - - sql_limit_dialect - _dbh_details - _use_insert_returning - _supports_insert_returning + sql_limit_dialect - _use_placeholders - _supports_placeholders - _determine_supports_placeholders + _inner_join_to_node + _group_over_selection + _prefetch_autovalues + _extract_order_criteria + _max_column_bytesize +); - _use_typeless_placeholders - _supports_typeless_placeholders - _determine_supports_typeless_placeholders +# the capability framework +# not sure if CMOP->initialize does evil things to DBIC::S::DBI, fix if a problem +push @unimplemented, ( grep + { $_ =~ /^ _ (?: use | supports | determine_supports ) _ /x } + ( Class::MOP::Class->initialize('DBIx::Class::Storage::DBI')->get_all_method_names ) ); for my $method (@unimplemented) { @@ -414,8 +409,6 @@ C, C, C and C. around connect_info => sub { my ($next, $self, $info, @extra) = @_; - my $wantarray = wantarray; - my $merge = Hash::Merge->new('LEFT_PRECEDENT'); my %opts; @@ -433,8 +426,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/}) { @@ -451,11 +445,11 @@ around connect_info => sub { $self->_master_connect_info_opts(\%opts); - my (@res, $res); - if ($wantarray) { + my @res; + if (wantarray) { @res = $self->$next($info, @extra); } else { - $res = $self->$next($info, @extra); + $res[0] = $self->$next($info, @extra); } # Make sure master is blessed into the correct class and apply role to it. @@ -468,7 +462,7 @@ around connect_info => sub { # link pool back to master $self->pool->master($master); - $wantarray ? @res : $res; + wantarray ? @res : $res[0]; }; =head1 METHODS @@ -683,7 +677,7 @@ sub execute_reliably { $self->read_handler($current); }; - return $want_array ? @result : $result[0]; + return wantarray ? @result : $result[0]; } =head2 set_reliable_storage @@ -753,7 +747,7 @@ sub limit_dialect { foreach my $source ($self->all_storages) { $source->limit_dialect(@_); } - return $self->master->quote_char; + return $self->master->limit_dialect; } =head2 quote_char