X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FODBC.pm;h=09a7c6b4c5c1a7607cf4a86566748788f3734ec3;hb=5960a19503062a9725068f9e8ed067b9ab6e8293;hp=d7b45097d0d487e6706736f494c406751db5b9ba;hpb=c1e64353bd426295d8ab946bec35d695e5a38d7c;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Storage/DBI/ODBC.pm b/lib/DBIx/Class/Storage/DBI/ODBC.pm index d7b4509..09a7c6b 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC.pm @@ -7,8 +7,7 @@ use base qw/DBIx::Class::Storage::DBI/; sub _rebless { my ($self) = @_; - my $dbh = $self->dbh; - my $dbtype = eval { $dbh->get_info(17) }; + my $dbtype = eval { $self->dbh->get_info(17) }; unless ( $@ ) { # Translate the backend name into a perl identifier $dbtype =~ s/\W/_/gi; @@ -18,6 +17,14 @@ sub _rebless { } } +sub _dbh_last_insert_id { + my ($self, $dbh, $source, $col) = @_; + + # punt: if there is no derived class for the specific backend, attempt + # to use the DBI->last_insert_id, which may not be sufficient (see the + # discussion of last_insert_id in perldoc DBI) + return $dbh->last_insert_id(undef, undef, $source->from, $col); +} 1;