deref table name if needed, check all columns for identity column not just PK
Rafael Kitover [Tue, 2 Feb 2010 13:33:57 +0000 (13:33 +0000)]
lib/DBIx/Class/Storage/DBI/Sybase/ASA.pm

index 9820060..59c9ae9 100644 (file)
@@ -40,9 +40,10 @@ sub insert {
 
   if (not $is_identity_insert) {
     my ($identity_col) = grep $source->column_info($_)->{is_auto_increment},
-      $source->primary_columns;
+      $source->columns;
     my $dbh = $self->_get_dbh;
     my $table_name = $source->from;
+    $table_name    = $$table_name if ref $table_name;
 
     my ($identity) = $dbh->selectrow_array("SELECT GET_IDENTITY('$table_name')");