Repository navigation
Conversation
Change `join_condition` to `join_condition_opt` in the outer_join grammar production so LEFT/RIGHT/FULL JOIN works without an explicit ON/USING clause, matching INNER JOIN behavior and MySQL compatibility. Fixes matrixorigin#24737
…ql_sql.y PR matrixorigin#24772 (fix/issue-24737-prisma-relation-joins) -- the .y grammar file merged cleanly; the generated .go file conflict was resolved by re-running goyacc.
LEFT JOIN without ON was already covered; add RIGHT JOIN variant to verify all outer join types parse correctly without ON/USING.
# Conflicts: # pkg/sql/parsers/dialect/mysql/mysql_sql.go
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Merge Queue Status
This pull request spent 1 hour 39 minutes 59 seconds in the queue, with no time running CI. ReasonThe pull request can't be updated
HintYou should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. Tick the box to put this pull request back in the merge queue (same as
|
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#24737 ## What this PR does / why we need it: This PR continues the unfinished work from matrixorigin#24772 while preserving its original commits and authorship. The inherited change allowed LEFT/RIGHT/FULL OUTER JOIN without `ON` or `USING`. Review established that this is not valid MySQL outer-join syntax and that conditionless JOIN semantics should remain limited to inner/cross-product forms. The implementation now: - keeps `ON` or `USING` mandatory for LEFT, RIGHT, and FULL OUTER JOIN; - returns the explicit parser error `outer join requires ON/USING clause` when the condition is missing; - continues accepting ordinary JOIN, INNER JOIN, CROSS JOIN, STRAIGHT_JOIN, and NATURAL OUTER JOIN without an explicit condition where their grammar permits it; - removes the inherited positive BVT cases that executed conditionless outer joins; - covers LEFT/RIGHT/FULL, derived-table, trailing-clause, chained-join, valid `ON/USING`, and adjacent join semantics. ## Validation - regenerated `mysql_sql.go` from `mysql_sql.y` with zero parser conflicts - verified parser generation is deterministic (`make -B -C pkg/sql/parsers/dialect/mysql mysql_sql.go` leaves no diff) - `go test -count=1 -run '^TestOuterJoinRequiresCondition$' ./pkg/sql/parsers/dialect/mysql` - `go test -race -count=10 -run '^TestOuterJoinRequiresCondition$' ./pkg/sql/parsers/dialect/mysql` - `go test -count=1 ./pkg/sql/parsers/...` - `go vet ./pkg/sql/parsers/...` - `git diff --check` --------- Co-authored-by: ULookup <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#24737 ## What this PR does / why we need it: This PR continues the unfinished work from matrixorigin#24772 while preserving its original commits and authorship. The inherited change allowed LEFT/RIGHT/FULL OUTER JOIN without `ON` or `USING`. Review established that this is not valid MySQL outer-join syntax and that conditionless JOIN semantics should remain limited to inner/cross-product forms. The implementation now: - keeps `ON` or `USING` mandatory for LEFT, RIGHT, and FULL OUTER JOIN; - returns the explicit parser error `outer join requires ON/USING clause` when the condition is missing; - continues accepting ordinary JOIN, INNER JOIN, CROSS JOIN, STRAIGHT_JOIN, and NATURAL OUTER JOIN without an explicit condition where their grammar permits it; - removes the inherited positive BVT cases that executed conditionless outer joins; - covers LEFT/RIGHT/FULL, derived-table, trailing-clause, chained-join, valid `ON/USING`, and adjacent join semantics. ## Validation - regenerated `mysql_sql.go` from `mysql_sql.y` with zero parser conflicts - verified parser generation is deterministic (`make -B -C pkg/sql/parsers/dialect/mysql mysql_sql.go` leaves no diff) - `go test -count=1 -run '^TestOuterJoinRequiresCondition$' ./pkg/sql/parsers/dialect/mysql` - `go test -race -count=10 -run '^TestOuterJoinRequiresCondition$' ./pkg/sql/parsers/dialect/mysql` - `go test -count=1 ./pkg/sql/parsers/...` - `go vet ./pkg/sql/parsers/...` - `git diff --check` --------- Co-authored-by: ULookup <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#24737 ## What this PR does / why we need it: This PR continues the unfinished work from matrixorigin#24772 while preserving its original commits and authorship. The inherited change allowed LEFT/RIGHT/FULL OUTER JOIN without `ON` or `USING`. Review established that this is not valid MySQL outer-join syntax and that conditionless JOIN semantics should remain limited to inner/cross-product forms. The implementation now: - keeps `ON` or `USING` mandatory for LEFT, RIGHT, and FULL OUTER JOIN; - returns the explicit parser error `outer join requires ON/USING clause` when the condition is missing; - continues accepting ordinary JOIN, INNER JOIN, CROSS JOIN, STRAIGHT_JOIN, and NATURAL OUTER JOIN without an explicit condition where their grammar permits it; - removes the inherited positive BVT cases that executed conditionless outer joins; - covers LEFT/RIGHT/FULL, derived-table, trailing-clause, chained-join, valid `ON/USING`, and adjacent join semantics. ## Validation - regenerated `mysql_sql.go` from `mysql_sql.y` with zero parser conflicts - verified parser generation is deterministic (`make -B -C pkg/sql/parsers/dialect/mysql mysql_sql.go` leaves no diff) - `go test -count=1 -run '^TestOuterJoinRequiresCondition$' ./pkg/sql/parsers/dialect/mysql` - `go test -race -count=10 -run '^TestOuterJoinRequiresCondition$' ./pkg/sql/parsers/dialect/mysql` - `go test -count=1 ./pkg/sql/parsers/...` - `go vet ./pkg/sql/parsers/...` - `git diff --check` --------- Co-authored-by: ULookup <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
issue #24737
What this PR does / why we need it:
This PR continues the unfinished work from #24772 while preserving its original commits and authorship.
The inherited change allowed LEFT/RIGHT/FULL OUTER JOIN without
ONorUSING. Review established that this is not valid MySQL outer-join syntax and that conditionless JOIN semantics should remain limited to inner/cross-product forms.The implementation now:
ONorUSINGmandatory for LEFT, RIGHT, and FULL OUTER JOIN;outer join requires ON/USING clausewhen the condition is missing;ON/USING, and adjacent join semantics.Validation
mysql_sql.gofrommysql_sql.ywith zero parser conflictsmake -B -C pkg/sql/parsers/dialect/mysql mysql_sql.goleaves no diff)go test -count=1 -run '^TestOuterJoinRequiresCondition$' ./pkg/sql/parsers/dialect/mysqlgo test -race -count=10 -run '^TestOuterJoinRequiresCondition$' ./pkg/sql/parsers/dialect/mysqlgo test -count=1 ./pkg/sql/parsers/...go vet ./pkg/sql/parsers/...git diff --check