Repository navigation
fix(frontend): quote LCA primary key references - #26200
Merged
Merged
Conversation
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? |
XuPeng-SH
approved these changes
Jul 27, 2026
XuPeng-SH
left a comment
Contributor
There was a problem hiding this comment.
Reviewed the LCA delete-probe SQL path.
The fix now quotes primary-key identifiers consistently in the VALUES alias and join predicates, while preserving key order and the existing cast behavior. The added unit/BVT coverage matches the reachable failure modes for reserved-word and punctuation PK names, and I did not find a high-confidence blocking correctness issue in this diff.
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#26071 ## What this PR does / why we need it: `handleDelsOnLCA` quoted the LCA database, table, and projected columns, but inserted raw primary-key names into the generated VALUES alias and join predicates. Reserved words or punctuation in a primary-key column therefore produced invalid SQL during DATA BRANCH DIFF, MERGE, and PICK. This change quotes the LCA primary-key identifiers once and reuses the same ordered list for the VALUES alias, LCA references, and probe references. It preserves the existing key order and cast behavior. Coverage includes: - a unit test that captures the generated join SQL for a reserved-word primary key; - BVT cases for single and composite quoted primary keys across DIFF, MERGE, and PICK. Validation: - `make build` - `go vet ./pkg/frontend` - `go test ./pkg/frontend -run "^TestHandleDelsOnLCA_SQLPaths$" -count=1` - `mo-tester ... -i branch_lca_quoted_pk -r 100` (32/32 passed) Co-authored-by: XuPeng-SH <[email protected]>
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#26071 ## What this PR does / why we need it: `handleDelsOnLCA` quoted the LCA database, table, and projected columns, but inserted raw primary-key names into the generated VALUES alias and join predicates. Reserved words or punctuation in a primary-key column therefore produced invalid SQL during DATA BRANCH DIFF, MERGE, and PICK. This change quotes the LCA primary-key identifiers once and reuses the same ordered list for the VALUES alias, LCA references, and probe references. It preserves the existing key order and cast behavior. Coverage includes: - a unit test that captures the generated join SQL for a reserved-word primary key; - BVT cases for single and composite quoted primary keys across DIFF, MERGE, and PICK. Validation: - `make build` - `go vet ./pkg/frontend` - `go test ./pkg/frontend -run "^TestHandleDelsOnLCA_SQLPaths$" -count=1` - `mo-tester ... -i branch_lca_quoted_pk -r 100` (32/32 passed) Co-authored-by: XuPeng-SH <[email protected]>
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#26071 ## What this PR does / why we need it: `handleDelsOnLCA` quoted the LCA database, table, and projected columns, but inserted raw primary-key names into the generated VALUES alias and join predicates. Reserved words or punctuation in a primary-key column therefore produced invalid SQL during DATA BRANCH DIFF, MERGE, and PICK. This change quotes the LCA primary-key identifiers once and reuses the same ordered list for the VALUES alias, LCA references, and probe references. It preserves the existing key order and cast behavior. Coverage includes: - a unit test that captures the generated join SQL for a reserved-word primary key; - BVT cases for single and composite quoted primary keys across DIFF, MERGE, and PICK. Validation: - `make build` - `go vet ./pkg/frontend` - `go test ./pkg/frontend -run "^TestHandleDelsOnLCA_SQLPaths$" -count=1` - `mo-tester ... -i branch_lca_quoted_pk -r 100` (32/32 passed) Co-authored-by: XuPeng-SH <[email protected]>
This branch was previously deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #26071
What this PR does / why we need it:
handleDelsOnLCAquoted the LCA database, table, and projected columns, but inserted raw primary-key names into the generated VALUES alias and join predicates. Reserved words or punctuation in a primary-key column therefore produced invalid SQL during DATA BRANCH DIFF, MERGE, and PICK.This change quotes the LCA primary-key identifiers once and reuses the same ordered list for the VALUES alias, LCA references, and probe references. It preserves the existing key order and cast behavior.
Coverage includes:
Validation:
make buildgo vet ./pkg/frontendgo test ./pkg/frontend -run "^TestHandleDelsOnLCA_SQLPaths$" -count=1mo-tester ... -i branch_lca_quoted_pk -r 100(32/32 passed)