Fixed user-defined sequence assignment
Andy Grundman [Tue, 9 Aug 2005 00:44:36 +0000 (00:44 +0000)]
lib/DBIx/Class/PK/Auto/Oracle.pm
lib/DBIx/Class/PK/Auto/Pg.pm

index 40f4190..420d544 100644 (file)
@@ -19,7 +19,9 @@ sub get_autoinc_seq {
   my $self = shift;
   
   # return the user-defined sequence if known
-  return $self->sequence if ($self->sequence);
+  if ($self->sequence) {
+    return $self->{_autoinc_seq} = $self->sequence;
+  }
   
   # look up the correct sequence automatically
   my $dbh = $self->storage->dbh;
index eb6856c..a22aa02 100644 (file)
@@ -18,7 +18,9 @@ sub get_autoinc_seq {
   my $self=shift;
   
   # return the user-defined sequence if known
-  return $self->sequence if ($self->sequence);
+  if ($self->sequence) {
+    return $self->{_autoinc_seq} = $self->sequence;
+  }
   
   my $dbh= $self->storage->dbh;
     my $sth    = $dbh->column_info( undef, undef, $self->_table_name, '%');