Skip to content

Commit

Permalink
Fix uninitializied warnings in ::Storage::Sybase::ASE, shuffle logic …
Browse files Browse the repository at this point in the history
…a bit
  • Loading branch information
ribasushi committed Nov 25, 2011
1 parent c7bc500 commit aadfe18
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -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
Expand Down
24 changes: 20 additions & 4 deletions lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm
Expand Up @@ -263,17 +263,33 @@ 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,
$self->_set_table_identity_sql($op => $table, 'off'),
);
}

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);
Expand Down

0 comments on commit aadfe18

Please sign in to comment.