X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI.pm;h=b091e6428c48a72ffba735672de28ebd46e9647e;hb=52416317;hp=d07bb76d34b533aa7329dff0db75462e7e0130e9;hpb=ea95892eb6a71366db32b04137c7f2ee3b4ef841;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index d07bb76..b091e64 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1522,7 +1522,7 @@ sub _fix_bind_params { if ( defined( $_ && $_->[1] ) ) { map { qq{'$_'}; } @{$_}[ 1 .. $#$_ ]; } - else { q{'NULL'}; } + else { q{NULL}; } } @bind; } @@ -2103,11 +2103,13 @@ sub source_bind_attributes { my ($self, $source) = @_; my $bind_attributes; - foreach my $column ($source->columns) { - my $data_type = $source->column_info($column)->{data_type} || ''; - $bind_attributes->{$column} = $self->bind_attribute_by_data_type($data_type) - if $data_type; + my $colinfo = $source->columns_info; + + for my $col (keys %$colinfo) { + if (my $dt = $colinfo->{$col}{data_type} ) { + $bind_attributes->{$col} = $self->bind_attribute_by_data_type($dt) + } } return $bind_attributes;