fix stupid identity bug, test empty insert (works), test DTs (not working yet)
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Sybase / ASA.pm
index 59c9ae9..3e78845 100644 (file)
@@ -38,9 +38,11 @@ sub insert {
      ? 1
      : 0;
 
-  if (not $is_identity_insert) {
-    my ($identity_col) = grep $source->column_info($_)->{is_auto_increment},
-      $source->columns;
+  my $identity_col = List::Util::first {
+      $source->column_info($_)->{is_auto_increment} 
+  } $source->columns;
+
+  if ((not $is_identity_insert) && $identity_col) {
     my $dbh = $self->_get_dbh;
     my $table_name = $source->from;
     $table_name    = $$table_name if ref $table_name;