You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since 1.1.0 a join gets wrapped in parentheses together with its children whenever it has any, so leftJoinAndSelect("u.profile", "p").leftJoinAndSelect("p.country", "c") now emits LEFT JOIN ("profile" "p" LEFT JOIN "country" "c" ON ...) ON ... instead of two flat LEFT JOINs. The nesting was added in #11137 to keep an inner child join from filtering out rows that its outer parent preserves, but it is applied to every combination, including left under left, where flat emission returns exactly the same rows. The parentheses pin the join order, and the reporter saw a seven-table query regress to ~19s averages on PostgreSQL 18 after upgrading.
So the parentheses are now gated on the case they were introduced for: an inner child join under a left joined parent. Every other combination goes back to the flat form 1.0.0 emitted. The behaviour tests from #11137 pass unchanged, and the two SQL string assertions that were updated in that PR for a left-under-left chain move back to the flat expectation.
Pull-Request Checklist
Code is up-to-date with the master branch
This pull request links a relevant issue using a closing keyword: Fixes #NNNN, Closes #NNNN, or Resolves #NNNN
There are new or updated tests validating the change (tests/**.test.ts)
Documentation has been updated to reflect this change (docs/docs/**.md) — N/A (no documented behaviour changes, only the emitted SQL shape)
1. #12792 test reference missing✓ Resolved📘 Rule violation⚙ Maintainability
Description
The new regression tests are correctly located in the functional suite but do not identify issue
#12792 in a test comment. This omits the issue reference required for applicable issue-fix tests.
+ it("should not nest a child left join inside its left joined parent", () =>+ Promise.all(
Evidence
PR Compliance ID 3 requires applicable issue-fix tests in test/functional to include an issue
reference in a test comment. The newly added regression test begins at line 399 without any comment
referencing #12792, and the repository contains no TypeScript reference to that issue.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The regression tests for issue `#12792` do not include the applicable issue reference required by the functional-test compliance rule.
## Issue Context
Add a concise comment identifying these cases as regression coverage for GitHub issue `#12792`, while keeping the tests in the functional suite.
## Fix Focus Areas
- test/functional/query-builder/join/query-builder-joins.test.ts[399-412]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Author self-review: I have reviewed the code review findings, and addressed the relevant ones.
Tip of the day
💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all
1. #12792 test reference missing 📘 Rule violation⚙ Maintainability
Description
The new regression tests are correctly located in the functional suite but do not identify issue
#12792 in a test comment. This omits the issue reference required for applicable issue-fix tests.
+ it("should not nest a child left join inside its left joined parent", () =>+ Promise.all(
Evidence
PR Compliance ID 3 requires applicable issue-fix tests in test/functional to include an issue
reference in a test comment. The newly added regression test begins at line 399 without any comment
referencing #12792, and the repository contains no TypeScript reference to that issue.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The regression tests for issue `#12792` do not include the applicable issue reference required by the functional-test compliance rule.
## Issue Context
Add a concise comment identifying these cases as regression coverage for GitHub issue `#12792`, while keeping the tests in the functional suite.
## Fix Focus Areas
- test/functional/query-builder/join/query-builder-joins.test.ts[399-412]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12792
Description of change
Since 1.1.0 a join gets wrapped in parentheses together with its children whenever it has any, so
leftJoinAndSelect("u.profile", "p").leftJoinAndSelect("p.country", "c")now emitsLEFT JOIN ("profile" "p" LEFT JOIN "country" "c" ON ...) ON ...instead of two flatLEFT JOINs. The nesting was added in #11137 to keep an inner child join from filtering out rows that its outer parent preserves, but it is applied to every combination, including left under left, where flat emission returns exactly the same rows. The parentheses pin the join order, and the reporter saw a seven-table query regress to ~19s averages on PostgreSQL 18 after upgrading.So the parentheses are now gated on the case they were introduced for: an inner child join under a left joined parent. Every other combination goes back to the flat form 1.0.0 emitted. The behaviour tests from #11137 pass unchanged, and the two SQL string assertions that were updated in that PR for a left-under-left chain move back to the flat expectation.
Pull-Request Checklist
masterbranchFixes #NNNN,Closes #NNNN, orResolves #NNNNtests/**.test.ts)docs/docs/**.md) — N/A (no documented behaviour changes, only the emitted SQL shape)