Skip Menu |

This queue is for tickets about the DBIx-Class CPAN distribution.

Report information
The Basics
Id: 40265
Status: resolved
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: adrian.doolittle [...] morganstanley.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: 0.08103



Similar to bug 21260 I am getting the following error: DBIx::Class::Schema::populate(): Can't locate DBI object method "last_insert_rowid" via package "DBD::Sybase::db" at /xxx/perl5/PROJ/DBIx-Class/0.08010/lib/perl5/DBIx/Class/Storage/DBI.pm line 1275. I believe last_insert_rowid should be switched to last_insert_id. Thanks, Adrian
Sounds reasonable. Could you please provide a patch with a failing test against t/74mssql.t?
Subject: Storage::DBI::Sybase needs last_insert_id handling
RT-Send-CC: adrian.doolittle [...] morganstanley.com
On Wed Oct 22 11:39:09 2008, dooladri wrote: Show quoted text
> Similar to bug 21260 I am getting the following error: > DBIx::Class::Schema::populate(): Can't locate DBI object method > "last_insert_rowid" via package "DBD::Sybase::db" at > /xxx/perl5/PROJ/DBIx-Class/0.08010/lib/perl5/DBIx/Class/Storage/DBI.pm > line 1275. > > I believe last_insert_rowid should be switched to last_insert_id.
A correct _dbh_last_insert_id method needs to be added for DBIx::Class::Storage::DBI::Sybase, which currently provides none. The base method in Storage::DBI defaults to SQLite's last_insert_rowid, which is probably never correct for any other database. At runtime, DBIC determines the correct sub-class to handle storage. Each subclass needs to provide something appropriate for last_insert_id. The correct handling varies greatly from one DB to the next. See the last_insert_id documentation for DBD::Sybase for caveats: http://search.cpan.org/~mewp/DBD-Sybase-1.09/Sybase.pm#Behavior_of_$dbh-%3Elast_insert_id Using DBI's last_insert_id may be sufficient for DBD::Sybase. If so, the same method used for DBD::ODBC may work: http://dev.catalystframework.org/svnweb/bast/revision?rev=4893 Sybase may provide some better means for obtaining the last_insert_id. Storage::DBI::ODBC::Microsoft_SQL_Server is a less trivial example. -Marc
No reply from original submitter, changing status to stalled.
DBIx::Class 0.08103 just released on CPAN fixes this RT.