From: Rafael Kitover Date: Wed, 10 Jun 2009 13:00:42 +0000 (+0000) Subject: cache rsrc in NoBindVars correctly X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=434cace97495b47136c78617db2a1730801df8fe;p=dbsrgits%2FDBIx-Class-Historic.git cache rsrc in NoBindVars correctly --- diff --git a/lib/DBIx/Class/Storage/DBI/NoBindVars.pm b/lib/DBIx/Class/Storage/DBI/NoBindVars.pm index 2e8231b..eac8295 100644 --- a/lib/DBIx/Class/Storage/DBI/NoBindVars.pm +++ b/lib/DBIx/Class/Storage/DBI/NoBindVars.pm @@ -50,7 +50,7 @@ sub _prep_for_execute { my @sql_part = split /\?/, $sql; my $new_sql; - my $result_sources = {}; + my $alias2src = $self->_resolve_ident_sources($ident); foreach my $bound (@$bind) { my $col = shift @$bound; @@ -60,9 +60,7 @@ sub _prep_for_execute { $col =~ s/^([^\Q${name_sep}\E]*)\Q${name_sep}\E//; my $alias = $1 || 'me'; - $result_sources->{$alias} ||= - $self->_resolve_ident_sources($ident)->{$alias}; - my $rsrc = $result_sources->{$alias}; + my $rsrc = $alias2src->{$alias}; my $datatype = $rsrc->column_info($col)->{data_type};