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;
$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};
+ my $datatype = $rsrc && $rsrc->column_info($col)->{data_type};
foreach my $data (@$bound) {
if(ref $data) {