cache autoinc sequence in column_info
Rafael Kitover [Sat, 6 Mar 2010 17:12:55 +0000 (17:12 +0000)]
lib/DBIx/Class/Storage/DBI.pm

index 4d4af27..221fa6e 100644 (file)
@@ -1378,7 +1378,7 @@ sub insert {
       if ( $col_info->{auto_nextval} ) {
         $updated_cols->{$col} = $to_insert->{$col} = $self->_sequence_fetch(
           'nextval',
-          $col_info->{sequence} ||
+          $col_info->{sequence} ||=
             $self->_dbh_get_autoinc_seq($self->_get_dbh, $source, $col)
         );
       }