in reply to Strange bug involving mysql, auto_increment, Class::DBI and Test::MockObject
From the Test::MockObject ChangeLog file:
- use UNIVERSAL::isa and UNIVERSAL::can modulesThese two module override &UNIVERAL::isa and &UNIVERSAL::can (obviously), and attempt to enforce their "proper" usage (called as a method, not as a function). Of course this is a subject not everyone agrees upon (just look at the CPAN reviews for the two UNIVERSAL:: modules to see this).
From your error messages, I can deduce that Class::DBI does not use &UNIVERSAL::can "properly", so that is the source of your error. Althougth the two errors that it is sandwiched between are (I suspect) bugs in UNIVERSAL::can since it really should handle those edge cases correctly.
UPDATE
Upon closer inspection of the issue, I found this at line 265 of Class::DBI:
Then given one of your fixes:line 255 > my @pk_values = $self->_attrs($self->primary_columns); line 265 > UNIVERSAL::can($_ => 'id') and $_ = $_->id for @pk_values;
Hardcode the primary key value when you 'create' (i.e. set 'test1' to something)I would suspect that this is possibly a bug in Class::DBI and maybe line 265 should read:
Or something similar.UNIVERSAL::can($_ => 'id') and $_ = $_->id for grep { defined $_ } @pk +_values;
However, it could also be argued that it worked before, and the "bug" is only introduced by the addition of UNIVERSAL::can. So I guess it all comes down to which author you want to complain to, chromatic or TBOWDEN :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Strange bug involving mysql, auto_increment, Class::DBI and Test::MockObject
by chromatic (Archbishop) on Dec 13, 2005 at 22:20 UTC | |
by stvn (Monsignor) on Dec 13, 2005 at 22:45 UTC |