-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
ranger: fix prefix index when charset is UTF-8 (#7194) #7231
Conversation
/run-all-tests |
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.
LGTM
/run-all-tests tidb-test=release-2.0 tikv=release-2.0 pd=release-2.0 |
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.
lgtm
if ic.Length != types.UnspecifiedLength && utf8.RuneCount(val) > ic.Length { | ||
rs := bytes.Runes(val) | ||
colValue := v.GetBytes() | ||
isUTF8Charset := colCharset == charset.CharsetUTF8 || colCharset == charset.CharsetUTF8MB4 |
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.
Can we extract a function to types
package, like
func TruncateValue(d *Datum, charset string, length int)
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.
never mind, this is a cherry-pick, we can do it later.
What have you changed? (mandatory)
cherry pick #7194 to release 2.0
What is the type of the changes? (mandatory)
How has this PR been tested? (mandatory)
Does this PR affect documentation (docs/docs-cn) update? (mandatory)
Does this PR affect tidb-ansible update? (mandatory)
Does this PR need to be added to the release notes? (mandatory)
Refer to a related PR or issue link (optional)
Benchmark result if necessary (optional)
Add a few positive/negative examples (optional)