... | ... |
@@ -1205,7 +1205,6 @@ sub _create_bind_values { |
1205 | 1205 |
for my $column (@$columns) { |
1206 | 1206 |
|
1207 | 1207 |
# Value |
1208 |
- my $value; |
|
1209 | 1208 |
if(ref $params->{$column} eq 'ARRAY') { |
1210 | 1209 |
my $i = $count->{$column} || 0; |
1211 | 1210 |
$i += $not_exists->{$column} || 0; |
... | ... |
@@ -1215,29 +1214,31 @@ sub _create_bind_values { |
1215 | 1214 |
$not_exists->{$column}++; |
1216 | 1215 |
} |
1217 | 1216 |
else { |
1218 |
- $value = $params->{$column}->[$k]; |
|
1217 |
+ push @$bind, $params->{$column}->[$k]; |
|
1219 | 1218 |
$found = 1; |
1220 | 1219 |
last |
1221 | 1220 |
} |
1222 | 1221 |
} |
1223 | 1222 |
next unless $found; |
1224 | 1223 |
} |
1225 |
- else { $value = $params->{$column} } |
|
1224 |
+ else { push @$bind, $params->{$column} } |
|
1226 | 1225 |
|
1227 | 1226 |
# Filter |
1228 |
- my $f = $filter->{$column} || $self->{default_out_filter} || ''; |
|
1229 |
- $value = $f->($value) if $f; |
|
1227 |
+ if (my $f = $filter->{$column} || $self->{default_out_filter} || '') { |
|
1228 |
+ $bind->[-1] = $f->($bind->[-1]); |
|
1229 |
+ } |
|
1230 | 1230 |
|
1231 | 1231 |
# Type rule |
1232 |
- my $tf1 = $self->{"_into1"}->{dot}->{$column} |
|
1233 |
- || $type_filters->{1}->{$column}; |
|
1234 |
- $value = $tf1->($value) if $tf1; |
|
1235 |
- my $tf2 = $self->{"_into2"}->{dot}->{$column} |
|
1236 |
- || $type_filters->{2}->{$column}; |
|
1237 |
- $value = $tf2->($value) if $tf2; |
|
1232 |
+ if ($self->{_type_rule_is_called}) { |
|
1233 |
+ my $tf1 = $self->{"_into1"}->{dot}->{$column} |
|
1234 |
+ || $type_filters->{1}->{$column}; |
|
1235 |
+ $bind->[-1] = $tf1->($bind->[-1]) if $tf1; |
|
1236 |
+ my $tf2 = $self->{"_into2"}->{dot}->{$column} |
|
1237 |
+ || $type_filters->{2}->{$column}; |
|
1238 |
+ $bind->[-1] = $tf2->($bind->[-1]) if $tf2; |
|
1239 |
+ } |
|
1238 | 1240 |
|
1239 | 1241 |
# Bind values |
1240 |
- push @$bind, $value; |
|
1241 | 1242 |
push @$types, $bind_type->{$column}; |
1242 | 1243 |
|
1243 | 1244 |
# Count up |