Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix merging left_joins to maintain its own join_type context #36120

Merged
merged 1 commit into from
Apr 27, 2019

Conversation

kamipo
Copy link
Member

@kamipo kamipo commented Apr 27, 2019

This fixes a regression for #35864.

Usually, stashed joins (mainly eager loading) are performed as LEFT
JOINs.
But the case of merging joins/left_joins of different class, that
(stashed) joins are performed as the same join_type as the parent
context for now.
Since #35864, both (joins/left_joins) stashed joins might be contained
in joins_values, so each stashed joins should maintain its own
join_type context.

Fixes #36103.

This fixes a regression for rails#35864.

Usually, stashed joins (mainly eager loading) are performed as LEFT
JOINs.
But the case of merging joins/left_joins of different class, that
(stashed) joins are performed as the same `join_type` as the parent
context for now.
Since rails#35864, both (joins/left_joins) stashed joins might be contained
in `joins_values`, so each stashed joins should maintain its own
`join_type` context.

Fixes rails#36103.
@kamipo kamipo merged commit 99df469 into rails:master Apr 27, 2019
@kamipo kamipo deleted the should_maintain_join_type branch April 27, 2019 14:26
kamipo added a commit that referenced this pull request Apr 27, 2019
Fix merging left_joins to maintain its own `join_type` context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6.0.0.rc1: ActiveRecord builds a query using INNER JOIN instead of LEFT OUTER JOIN
1 participant