From: Andy Grundman Date: Tue, 9 Aug 2005 00:44:36 +0000 (+0000) Subject: Fixed user-defined sequence assignment X-Git-Tag: v0.03001~45 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5b34b2f99fbeca45631dce950d43d3e6f88af3ca;p=dbsrgits%2FDBIx-Class.git Fixed user-defined sequence assignment --- diff --git a/lib/DBIx/Class/PK/Auto/Oracle.pm b/lib/DBIx/Class/PK/Auto/Oracle.pm index 40f4190..420d544 100644 --- a/lib/DBIx/Class/PK/Auto/Oracle.pm +++ b/lib/DBIx/Class/PK/Auto/Oracle.pm @@ -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; diff --git a/lib/DBIx/Class/PK/Auto/Pg.pm b/lib/DBIx/Class/PK/Auto/Pg.pm index eb6856c..a22aa02 100644 --- a/lib/DBIx/Class/PK/Auto/Pg.pm +++ b/lib/DBIx/Class/PK/Auto/Pg.pm @@ -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, '%');