cmd, expression, parser: support GBK for builtin function char()#29543
cmd, expression, parser: support GBK for builtin function char()#29543ti-chi-bot merged 9 commits intopingcap:masterfrom
Conversation
|
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. DetailsReviewer can indicate their review by submitting an approval review. |
|
/cc @xiongjiwei @zimulala @tangenta @wjhuang2016 |
expression/builtin_string_vec.go
Outdated
There was a problem hiding this comment.
dest in the Decode should not be nil. We should create a buffer before the loop to avoid to allocate memory in the transform.
21ce869 to
deaf542
Compare
|
@hawkingrei: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
parser/charset/encoding.go
Outdated
There was a problem hiding this comment.
Use encodingLegacy instead of utf-8?
There was a problem hiding this comment.
I think utf-8 is better. encodingLegacy may change someday, and validUTF8 is only design for utf8.
parser/charset/encoding.go
Outdated
There was a problem hiding this comment.
Why do we need to check utf8 here?
There was a problem hiding this comment.
I got it. But it seems that only char using this check? Has this check been done elsewhere?
There was a problem hiding this comment.
If we have some invalid utf8 characters in store, add this check could find them. After add this, the behavior between utf8 and gbk will be same. @zimulala
There was a problem hiding this comment.
Well, I mean we already do check on the parser layer, and we'll do it repeatedly when we call it.
| // TODO: Uncomment it when issue #29685 be closed | ||
| // {"65", -1, 67.5, "utf8", nil, 1}, // with utf8, return nil | ||
| // {"a", -1, 67.5, "utf8", nil, 2}, // with utf8, return nil | ||
| // TODO: Uncomment it when gbk be added into charsetInfos |
There was a problem hiding this comment.
What is the charsetInfos here?
If it is the session variable, we can try ctx.GetSessionVars().SetSystemVar(variable.CharacterSetConnection, v.charset).
There was a problem hiding this comment.
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 43aadbf |
|
@Defined2014: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: close #29461
Problem Summary: support GBK for builtin function char()
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note