From: Arthur Axel "fREW" Schmidt Date: Thu, 20 Aug 2009 21:54:04 +0000 (+0000) Subject: add some basic guards to get rid of warnings X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=be294d66f165fa65c7663dc5015503516e74e419;p=dbsrgits%2FDBIx-Class-Historic.git add some basic guards to get rid of warnings --- diff --git a/lib/DBIx/Class/Storage/DBI/MSSQL.pm b/lib/DBIx/Class/Storage/DBI/MSSQL.pm index b0da553..8742559 100644 --- a/lib/DBIx/Class/Storage/DBI/MSSQL.pm +++ b/lib/DBIx/Class/Storage/DBI/MSSQL.pm @@ -55,10 +55,14 @@ sub insert { @pk_cols{@pk_cols} = (); my @pk_guids = grep { + $source->column_info($_)->{data_type} + && $source->column_info($_)->{data_type} =~ /^uniqueidentifier/i } @pk_cols; my @auto_guids = grep { + $source->column_info($_)->{data_type} + && $source->column_info($_)->{data_type} =~ /^uniqueidentifier/i && $source->column_info($_)->{auto_nextval} @@ -87,7 +91,9 @@ sub _prep_for_execute { for my $col (keys %$fields) { # $ident is a result source object with INSERT/UPDATE ops - if ($ident->column_info ($col)->{data_type} =~ /^money\z/i) { + if ($ident->column_info ($col)->{data_type} + && + $ident->column_info ($col)->{data_type} =~ /^money\z/i) { my $val = $fields->{$col}; $fields->{$col} = \['CAST(? AS MONEY)', [ $col => $val ]]; }