-
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
Remove shard targeted keyspace from database qualifier on the query #17503
Conversation
Signed-off-by: Harshit Gangal <[email protected]>
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
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17503 +/- ##
==========================================
+ Coverage 67.68% 67.72% +0.03%
==========================================
Files 1584 1584
Lines 254505 254502 -3
==========================================
+ Hits 172255 172353 +98
+ Misses 82250 82149 -101 ☔ View full report in Codecov by Sentry. |
go/vt/sqlparser/ast_funcs.go
Outdated
case TableName: | ||
if expr.Qualifier.NotEmpty() { | ||
expr.Qualifier = NewIdentifierCS("") | ||
cursor.Replace(expr) |
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.
no need to replace here. it's just writing in the expression we already had there
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.
I tried the change and it fails.
TableName is not used by reference so I believe we have to do the replace.
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.
I refactored the methods as there were 3 functions which similar code.
Signed-off-by: Harshit Gangal <[email protected]>
Description
This PR handles the case where database qualifier is removed before sending the query down to vttablet for shard targeted queries.
It only removed the qualifier that matches the targeted keyspace.
Example:
Query send down to
shard 80-
will beselect 1 from t1 join vt_ks1.t2 join information_schema.tables
Related Issue(s)
Checklist
Deployment Notes