-
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
collation: add utf8mb4_zh_pinyin_tidb_as_cs collation interface #20504
Conversation
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
324046c
to
ebcccb6
Compare
Usage: /command [argument] The commands are: /ping ping the bot More Details
|
9a8bfca
to
64059f8
Compare
/run-all-tests |
1 similar comment
/run-all-tests |
# Conflicts: # go.mod # go.sum
# Conflicts: # go.mod # go.sum
if ok { | ||
return v | ||
if coll, err := charset.GetCollationByID(int(collate.RestoreCollationIDIfNeeded(c))); err == nil { | ||
return coll.Name | ||
} | ||
logutil.BgLogger().Warn( |
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.
log the err
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.
updated
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.
You should log it as a warning.
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.
The err and the original log say the same thing and the original log have more detail. It's better to use the original code.
expression/expr_to_pb.go
Outdated
} | ||
logutil.BgLogger().Warn( | ||
"Unable to get collation name from ID, use name of the default collation instead", | ||
zap.Int32("id", c), | ||
zap.Int("default collation ID", mysql.DefaultCollationID), | ||
zap.String("default collation", mysql.DefaultCollationName), | ||
) | ||
|
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.
this line can be removed.
util/collate/pinyin_tidb_as_cs.go
Outdated
|
||
package collate | ||
|
||
type zhPinyinTiDBASCS struct { |
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 does 'ASCS' mean exactly?
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 rename it to zhPinyinTiDBASCSCollator
and add comments. 'ASCS' for accent-sensitive and case-sensitive
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
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
/merge |
/run-all-tests |
@xiongjiwei merge failed. |
/run-check_dev |
/merge |
/run-all-tests |
@xiongjiwei merge failed. |
/run-unit-test |
What problem does this PR solve?
Problem Summary:
we are going to add a new collation named
utf8mb4_zh_pinyin_tidb_as_cs
for pinyin order, this PR is aim to add the interface for it.What is changed and how it works?
Proposal: #19984
What's Changed:
Related changes
Check List
Tests
Release note