The last line in that example produces the following SQL:
SELECT [s].[a].[id], [s].[a].[b_id], [s].[a].[c_id], [s].[a].[b_id],
[c].[id] AS [c_id_0] FROM (SELECT * FROM [s].[a] INNER JOIN [s].[b] ON
([s].[b].[b_id] = [s].[a].[b_id])) AS [s__a] LEFT OUTER JOIN [s].[c]
AS [c] ON ([c].[id] = [s].[a].[c_id])
Note the table alias [s__a].
This statement produces multiple errors from the DBMS when executed:
The column 'b_id' was specified multiple times for 's__a'.
The multi-part identifier "s.a.c_id" could not be bound.
The multi-part identifier "s.a.id" could not be bound.
... so on for s.a.b_id, s.a.c_id, s.a.b_id
Wow, that is a complex case. I don't think that situations where you
are joining separately from graphing are fully tested, even without
throwing in schemas. At least you didn't throw in self referential
Anyway, please test the patch at http://pastie.org/815474.txt.
The patch is causing problems in post-loading less-complex
schema-qualified eager graphs -- I get a nil primary_record in
eager_graph_build_associations. It looks like 'master' is now schema
unqualified but the record_graph is still keyed by a unsplit symbol
I'd like as much information as you can give me about it. If you
could pastie or send me the association part of your model files, the
migrations/database schema, and the eager graph queries, I could
probably get things working.
Test case: http://pastie.org/817379
this seems to be the missing part of the patch
Jeremy, your patch fixes the implicit qualifier for the conditions and
record graph keys but we still needed to select the source dataset
columns without the schema.
I'm sorry for taking so long to get back to you on this, but I've been
swamped at work recently. I finally had time tonight to work on a
proper patch, located at http://pastie.org/833854.txt. I've applied
this patch to my private branch, and will probably push it to github
next week after more testing. Please test it with your code and make
sure it works correctly.
It's passing all our tests.
Great! I just pushed it to GitHub along with quite a few other