[Dbix-class] order_by interfering with has_many fetch
Darin McBride
darin.mcbride at shaw.ca
Mon Nov 16 02:09:05 GMT 2015
On Monday November 16 2015 1:17:55 AM Peter Rabbitson wrote:
> On 11/15/2015 11:23 PM, Darin McBride wrote:
> > Maybe it's just my non-DBIC background, I just figured the DB was giving
> > me
> > everything in the right order already ;) But I guess DBIC is trying to
> > collapse objects so that multiple rows with those prefetches will return
> > the same actual object reference? Or something else entirely, which I
> > don't understand :)
>
> I will explain this separately, however:
> > To me, me.name is a unique key, so that should indicate stability, no?
> > Now, I can fully appreciate that the actual definition of the table may
> > not indicate to DBIC that it's a unique key, though I tried using
> > add_unique_constraint for name, and that didn't help any.
>
> Are you saying that you did:
>
> __PACKAGE__->add-unique_constraint( ... => [ 'name' ]);
>
> AND
>
> The 'name' column is *NOT* marked as is_nullable => 1 in the DBIC metadata
>
> AND
>
> you *still* got the warning?
>
> If this is the case - this is in fact a rather serious bug and I need to
> investigate this further...
Please don't. I must have done something wrong the first time. When I try
again, because I have to reverify everything when I'm not 100% sure, I can add
that unique constraint and remove the me.id on the order, and suddenly it
works without a warning. Sorry for the distress.
More information about the DBIx-Class
mailing list