Closed paraseba closed 12 years ago
this pull request fixes this bug and adds some tests :
I've pulled McCraig's fix. Can you verify that it fixes the bug?
It seems fixed to me. If you still see a problem Parseba, please reopen and make sure to include both the generated sql and the expected sql. Thanks!
If you alias tables (as in (table {:users :u})) joins are not ordered according to table dependencies. It's a serious problem, since you can't reorder them manually, so it fails on execution.
I created a test case showing the problem here
https://github.com/paraseba/clojureql/commit/2e330a10b19d33cdde53868f7a8fa155e974658d
The first test case, without alias passes, the second, with table aliases fails.
I think the problem is the algorithm is using stringified column names to make a set difference. In case of alias, the string take the form "name alias" in table names, but not in column dependency vectors.