Backport associative fix to 1.0.x #79

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
4 participants
Contributor

l0st3d commented Mar 8, 2011

This is the backport of the associative fix I mentioned in another pull request, moments ago.

LauJensen and others added some commits Jan 12, 2011

@LauJensen LauJensen Fixed a monstrous bug which caused environments to be dropped between…
… compile and build-join

Example:

(join (table :t2)
      (-> (table :t1)
      (select (where (= :title "Dev")))
      (aggregate [[:sum/wage :as :sum]] [:id])
      (select (where (<= :sum 50000)))) :id)
SELECT t2.*,t1_subselect.id,t1_subselect.sum FROM t2 JOIN (SELECT t1.id,sum(t1.wage) AS sum FROM t1 WHERE (t1.title = ?) GROUP BY t1.id HAVING (t1.sum <= ?)) AS t1_subselect USING(id)

Notice how the values for t1.title and t1.sum are questionmarks.
a61199e
@LauJensen LauJensen Released the hotfixes to 1.0.0 as 1.0.1 3a25b4c
@doooks @l0st3d doooks fixed joins not carrying info through to other joins
joins should be sorted by dependency on previously joined tables

e.g. this

SELECT * FROM t1
JOIN t3 ON (t3.c = t2.c)
JOIN t2 ON (t1.a = t2.a)

is not valid, since t3 cannot be joined to anything on t1, without t2.  Should be

SELECT * FROM t1
JOIN t2 ON (t1.a = t2.a)
JOIN t3 ON (t3.c = t2.c)
73205bb
Collaborator

bendlas commented Jul 28, 2011

Already merged

bendlas closed this Jul 28, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment