[Dbix-class] chaining search() and +select/+as

BUCHMULLER Norbert norbi.lists at nix.hu
Thu Oct 16 16:15:16 BST 2008


On Thu, 9 Oct 2008 13:15:13 +0200 BUCHMULLER Norbert <norbi.lists at nix.hu>
wrote:

> Can you confirm if it's really a bug? (Or what was that I overlooked?)

As no-one objected that this is not a bug, I created a patch + test case
for it. See the attachment.

On one point I'm not certain: whether I should use _merge_attr() or do
the merge manually. (I mean that I wasn't able to go that deep into
_merge_attr() to be able to decide if it's kinda general-purpose
attribute merger or something specialized for 'join' and 'prefetch'.)

> I tried to create at least a test for that (see the attached diff). In
> fact there's another issue with 88result_set_column.t: for me it seems
> that $psrs->get_column() returns a DBIx::Class::ResultSetColumn object
> even if no column exists with that name, so all the '+select/+as' tests
> are kind of useless.. :-( I added a test for that bug, too ('+select/+as
> nonexistent_column'). Currently that other bug/feature masks the tests
> for my original problem.

I fixed those as well: I replaced the get_column() calls on the resultset
with get_column() calls on a row object (ie. changed
"$rs->get_column('...')" to "$rs->first->get_column('...')"). Now
t/88result_set_column.t passes for me on the 0.08 trunk (r4922).

Can you please review my patch?

norbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbic_chained_plusselect_fix.diff
Type: text/x-patch
Size: 2190 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20081016/5b392f30/dbic_chained_plusselect_fix.bin


More information about the DBIx-Class mailing list