From: Marc Mims Date: Mon, 6 Oct 2008 16:43:06 +0000 (+0000) Subject: Use DBI->last_insert_id for ODBC base class. X-Git-Tag: v0.08240~337 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=455833d94b90a5958a47fda7e3f73818377fb3d7;p=dbsrgits%2FDBIx-Class.git Use DBI->last_insert_id for ODBC base class. This closes RT #21260: Problem with last_insert_rowid: http://rt.cpan.org/Public/Bug/Display.html?id=21260 --- diff --git a/lib/DBIx/Class/Storage/DBI/ODBC.pm b/lib/DBIx/Class/Storage/DBI/ODBC.pm index 16e198e..e8b9c12 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC.pm @@ -17,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;