From: Peter Rabbitson Date: Thu, 24 Nov 2011 13:45:32 +0000 (+0100) Subject: Fix uninitializied warnings in ::Storage::Sybase::ASE, shuffle logic a bit X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aadfe180819e0cec3ab07f41a4fbd454d3694ee6;p=dbsrgits%2FDBIx-Class-Historic.git Fix uninitializied warnings in ::Storage::Sybase::ASE, shuffle logic a bit --- diff --git a/Changes b/Changes index 935f28e..6e74dfe 100644 --- a/Changes +++ b/Changes @@ -9,6 +9,7 @@ Revision history for DBIx::Class - Fix incorrect storage behavior when first call on a fresh schema is with_deferred_fk_checks - Fix incorrect dependency on Test::Simple/Builder (RT#72282) + - Fix uninitialized warning in ::Storage::Sybase::ASE * Misc - No longer depend on Variable::Magic now that a pure-perl diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm b/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm index 94239c2..352386e 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm @@ -263,8 +263,17 @@ sub _prep_for_execute { keys %$columns_info ; - if (($op eq 'insert' && $bound_identity_col) || - ($op eq 'update' && exists $args->[0]{$identity_col})) { + if ( + ($bound_identity_col and $op eq 'insert') + or + ( + $op eq 'update' + and + defined $identity_col + and + exists $args->[0]{$identity_col} + ) + ) { $sql = join ("\n", $self->_set_table_identity_sql($op => $table, 'on'), $sql, @@ -272,8 +281,15 @@ sub _prep_for_execute { ); } - if ($op eq 'insert' && (not $bound_identity_col) && $identity_col && - (not $self->{insert_bulk})) { + if ( + (not $bound_identity_col) + and + $identity_col + and + (not $self->{insert_bulk}) + and + $op eq 'insert' + ) { $sql = "$sql\n" . $self->_fetch_identity_sql($ident, $identity_col);