-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Reference Table DML Join Fix #17414
base: main
Are you sure you want to change the base?
Reference Table DML Join Fix #17414
Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Signed-off-by: Harshit Gangal <[email protected]>
79ddc2f
to
bc4eb4b
Compare
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17414 +/- ##
==========================================
- Coverage 67.67% 67.65% -0.02%
==========================================
Files 1583 1584 +1
Lines 254363 254372 +9
==========================================
- Hits 172140 172098 -42
- Misses 82223 82274 +51 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
mcmp.Exec(test.Query) | ||
stmt, err := sqlparser.NewTestParser().Parse(test.Query) | ||
require.NoError(mcmp.AsT(), err) | ||
sqlparser.RemoveKeyspaceIgnoreSysSchema(stmt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?
@@ -171,13 +171,15 @@ func getRoutesOrAlternates(lhsRoute, rhsRoute *Route) (*Route, *Route, Routing, | |||
return lhsRoute, rhsRoute, routingA, routingB, sameKeyspace | |||
} | |||
|
|||
if refA, ok := routingA.(*AnyShardRouting); ok { | |||
if refA, ok := routingA.(*AnyShardRouting); ok && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are we trying to do here? Could we add a comment for it?
Description
This PR fixes the issue with join query with reference table and sharded query.
An update/delete on reference table does not get routed to the source table.
This change checks the update/delete target and does not choose the alternate route of the query.
Backport Reason: Issue started after supporting join queries in DML from v20. This is a correctness issue as reference table is updated instead of the source table.
Related Issue(s)
Checklist