Skip to content

Commit e0b2184

Browse files
committed
Better to use db_col
1 parent 60da6c6 commit e0b2184

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • lib/Data/ObjectDriver/Driver

lib/Data/ObjectDriver/Driver/DBI.pm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,14 +642,16 @@ sub bulk_insert {
642642
# pass this directly to the backend DBD
643643
my $dbh = $driver->rw_handle($class->properties->{db});
644644
my $tbl = $driver->table_for($class);
645-
my @db_cols = map {$dbd->db_column_name($tbl, $_) } @{$cols};
646645

646+
my @db_cols;
647647
my %attrs;
648648
my $col_defs = $class->properties->{column_defs};
649649
for my $col (@$cols) {
650+
my $db_col = $dbd->db_column_name($tbl, $col);
651+
push @db_cols, $db_col;
650652
my $type = $col_defs->{$col} || 'char';
651653
my $attr = $dbd->bind_param_attributes($type) or next;
652-
$attrs{$col} = $attr;
654+
$attrs{$db_col} = $attr;
653655
}
654656

655657
return $dbd->bulk_insert($dbh, $tbl, \@db_cols, $data, \%attrs);

0 commit comments

Comments
 (0)