[Dbix-class] possible bug in DBIC:ResultSet?

Mark Hedges hedges at ucsd.edu
Tue Jun 6 22:36:57 CEST 2006


That wasn't actually the problem, sorry.

On Tue, 6 Jun 2006, Mark Hedges wrote:
> 
>     DBIx::Class::ResultSet::create(): Can't get last insert id 
>     at (script) line 93
>     Stack:
>     [/usr/share/perl5/Carp/Clan.pm:214]
>     [/usr/local/share/perl/5.8.8/DBIx/Class/Schema.pm:692]
>     [/usr/local/share/perl/5.8.8/DBIx/Class/Row.pm:408]
>     [/usr/local/share/perl/5.8.8/DBIx/Class/PK/Auto.pm:53]
>     [/usr/local/share/perl/5.8.8/DBIx/Class/ResultSet.pm:1054]
>     [(script):93]
>     [...]

I didn't look closely.  This is another entity that has a 
timestamp DEFAULT CURRENT_TIMESTAMP() as a column of an MCPK.

I tried adding 

  __PACKAGE__->load_components(qw( PK::Auto Core ));

to the class package for this entity.  It doesn't help.  Same error.

Probably because last_insert_id() is looking for an 
auto-increment value and doesn't know anything about timestamps.

I'm going to fake this one using a DateTime->now from the 
script instead of trying to use the MySQL server's NOW().

Mark



More information about the Dbix-class mailing list