[Bast-commits] r4893 - DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI

semifor at dev.catalyst.perl.org semifor at dev.catalyst.perl.org
Mon Oct 6 17:43:06 BST 2008


Author: semifor
Date: 2008-10-06 17:43:06 +0100 (Mon, 06 Oct 2008)
New Revision: 4893

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC.pm
Log:
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

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC.pm	2008-10-06 11:40:27 UTC (rev 4892)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC.pm	2008-10-06 16:43:06 UTC (rev 4893)
@@ -17,7 +17,15 @@
     }
 }
 
+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;
 
 =head1 NAME




More information about the Bast-commits mailing list