Open CyborgMaster opened 9 years ago
When joining through a table, running an outer join on the intermediary table causes incorrect SQL to be emitted.
Executing the following query, without the outer join,
Reminder.joins { [~reminder_type, ~reminder_type.ext] }.select { ~reminder_type.ext.description }
gives the correct SQL with the correct table name for the description field.
description
SELECT `reminder_types_ext`.`description`
However if the first table is joined with outer,
outer
Reminder.joins { [~reminder_type.outer, ~reminder_type.ext] }.select { ~reminder_type.ext.description }
then the table name is not retrieved and it tries (incorrectly) to guess the table name from the keypath.
SELECT `ext`.`description`
I know I could write this query as follows, which does work correctly,
Reminder.joins { [~reminder_type.outer.ext] }.select { ~reminder_type.ext.description }
but this isn't an option in my system as the query is built up from disparate parts of code each which request their own table joins and select statements. In either case the behavior isn't correct and we should fix it.
Any ideas?
When joining through a table, running an outer join on the intermediary table causes incorrect SQL to be emitted.
Executing the following query, without the outer join,
gives the correct SQL with the correct table name for the
description
field.However if the first table is joined with
outer
,then the table name is not retrieved and it tries (incorrectly) to guess the table name from the keypath.
I know I could write this query as follows, which does work correctly,
but this isn't an option in my system as the query is built up from disparate parts of code each which request their own table joins and select statements. In either case the behavior isn't correct and we should fix it.
Any ideas?