done mate,
http://datamapper.lighthouseapp.com/projects/20609-datamapper/tickets/1031-incorrect-sql-generated-for-associations-fetched-through-composite-keys-and-filters

sorry about the delay

On Sep 8, 3:41 pm, "Dan Kubb (dkubb)" <[email protected]> wrote:
> deepfryed,
>
> > > That's the SQL query I would expect to see generated from that query.
> > > What were you expecting?
>
> > The AND, OR operators are not properly scoped
>
> > SELECT "id", "name", "type", "code", "country" FROM "books" WHERE
> > "type" = 'fiction' AND ("code" = '1' AND "country" = 'au') OR ("code"
> > = '2' AND "country" = 'au') ORDER BY "id"
>
> > should be
>
> > SELECT "id", "name", "type", "code", "country" FROM "books" WHERE
> > ("type" = 'fiction') AND (("code" = '1' AND "country" = 'au') OR
> > ("code" = '2' AND "country" = 'au')) ORDER BY "id"
>
> Ahh, you are correct. I was wrong.
>
> I'm pretty sure that piece of code you mentioned earlier in the thread
> is the problem.  My intention with that code was to generate a WHERE
> clause using the simplest possible SQL query, omitting parenthesis
> when they are not necessary.  Apparently the code that figures out
> whether they are necessary or not needs some more work.
>
> Do you mind creating a ticket for this issue with a stand-alone script
> that reproduces the problem?http://datamapper.lighthouseapp.com/
>
> --
>
> Dan
> (dkubb)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to