From: Rafael Kitover Date: Sat, 25 Jul 2009 14:19:58 +0000 (+0000) Subject: use _resolve_column_info in NoBindVars X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=28cea3aa579791963ea117bdbfdbd4ee3e948555;p=dbsrgits%2FDBIx-Class-Historic.git use _resolve_column_info in NoBindVars --- diff --git a/lib/DBIx/Class/Storage/DBI/NoBindVars.pm b/lib/DBIx/Class/Storage/DBI/NoBindVars.pm index 9424d45..c3ba153 100644 --- a/lib/DBIx/Class/Storage/DBI/NoBindVars.pm +++ b/lib/DBIx/Class/Storage/DBI/NoBindVars.pm @@ -49,19 +49,12 @@ sub _prep_for_execute { my @sql_part = split /\?/, $sql; my $new_sql; - my ($alias2src, $rs_alias) = $self->_resolve_ident_sources($ident); + my $col_info = $self->_resolve_column_info($ident, [ map $_->[0], @$bind ]); foreach my $bound (@$bind) { my $col = shift @$bound; - my $name_sep = $self->_sql_maker_opts->{name_sep} || '.'; - - $col =~ s/^([^\Q${name_sep}\E]*)\Q${name_sep}\E//; - my $alias = $1 || $rs_alias; - - my $rsrc = $alias2src->{$alias}; - - my $datatype = $rsrc && $rsrc->column_info($col)->{data_type}; + my $datatype = $col_info->{$col}{data_type}; foreach my $data (@$bound) { $data = ''.$data if ref $data; diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm b/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm index 6859273..5053bae 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/NoBindVars.pm @@ -39,7 +39,7 @@ sub should_quote_value { if (my $key = List::Util::first { $type =~ /$_/i } keys %noquote) { return 0 if $noquote{$key}->($value); - } elsif($self->is_datatype_numeric($type) && $number->($value)) { + } elsif ($self->is_datatype_numeric($type) && $number->($value)) { return 0; }