[Dbix-class] accessor => single broken (again)

mike pulsation at gmail.com
Wed Apr 2 21:52:32 BST 2008


attached is a patch which includes a test that shows the broken single
accessor in DBIx::Class 0.08008 and 0.08010.  DBIx::Class 0.08009 was
not tested, but DBIx::Class 0.08007 works fine.  i'm not sure exactly
what's going on here, but this behavior has appeared in DBIx::Class
before.  it breaks the holy hell out of all of our applications in a
very nasty way.  with sharp, pointy teeth.  look at the bones!

in short, the aforementioned versions of DBIx::Class cause (at least
some) single accessors to return inflated objects for fields that are
NULL.

if we are using accessor =3D> single in some obtuse way, education is
welcome; however, it would be in everyone's best interests if this
behavior didn't change between releases, so i highly recommend that
a similar version to this test be added to the default test suite.

-mike

--- output of test using 0.08007 from default library path ---

$ PERL5LIB=3Dt/lib perl t/broken_single_accessor.t
1..2
ok 1 - genreid is NULL
ok 2 - genre accessor returns undef

--- output of test using DBIx::Class from svn ---

$ PERL5LIB=3Dt/lib:lib/ perl t/broken_single_accessor.t
1..2
ok 1 - genreid is NULL
not ok 2 - genre accessor returns undef
#   Failed test 'genre accessor returns undef'
#   at t/broken_single_accessor.t line 17.
# Looks like you failed 1 test of 2.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: accessor-single-broken.patch
Type: application/octet-stream
Size: 2657 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20080402/ca=
0e983c/accessor-single-broken.obj


More information about the DBIx-Class mailing list