Hi,

I have within my code a query that looks like this:-

    # join on everything useful here....
    my $join = [
        qw/event_status
          event_type
          company
          /,
       { bookings => 'performances' }
    ];

    my $attrs = {
        %{$attr},
        join     => $join,
        prefetch => $join,
        order_by => [ 'me.end_date', 'bookings.start' ],
    };

    my $res = $self->search( $search, $attrs );

bookings and performances are both has_many relationships, all the
others are belongs_to rels.

This query does not always return all the bookings objects for the top
level (event) objects.

The SQL appears to both be correct and return all the rows I would
expect.

If I remove the { bookings => 'performances' } fragment and add bookings
to the straight prefetch list, this works fine (but obviously I do a set
of subsidiary queries later when I access the performances rel).

Has anyone seen anything like this before, and have diagnosis
suggestions? I am somewhat dreading trying to write a test case to
demonstrate this effectively especially as it seems rather data
dependent.

[This is using DBIx::Class 0.07003 - in general all modules are current
as of this week as its a newish install]

        Nigel.
--
[ Nigel Metheringham           [EMAIL PROTECTED] ]
[ - Comments in this message are my own and not ITO opinion/policy - ]




_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to