-
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
parser, ddl: support decoding binary literal in set/enum #35822
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. Reviewer can indicate their review by submitting an approval review. |
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.
And seems some problems with ut
for i, e := range elems { | ||
trimmed := strings.TrimRight(e.Value, " ") | ||
tp.SetElemWithIsBinaryLit(i, trimmed, e.IsBinaryLiteral) | ||
fieldLen += len(trimmed) |
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 it is not len(tp.GetElem())
?
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.
They are the same string.
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 knew. My point is that tp.GetElem()
makes less assumption about what SetElemWithIsBinaryLit
is doing. I won't insist on the change.
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.
Actually the fieldLen
should not be calculated here because it may change after decoding. Let's remove it.
The one who changes SetElemWithIsBinaryLit
should check all the usages.
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/07cd79dc05f0757f41d58195588f5ef5c455fa7d |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 934ea38
|
@tangenta Please update mysql-test |
/hold |
/run-mysql-test tidb-test=pr/1856 |
/unhold |
TiDB MergeCI notify🔴 Bad News! New failing [2] after this pr merged.
|
Signed-off-by: you06 <you1474600@gmail.com> fix tests Signed-off-by: you06 <you1474600@gmail.com> fix test Signed-off-by: you06 <you1474600@gmail.com> update Signed-off-by: you06 <you1474600@gmail.com> update bazel Signed-off-by: you06 <you1474600@gmail.com> fix test Signed-off-by: you06 <you1474600@gmail.com> fix test Signed-off-by: you06 <you1474600@gmail.com> update Signed-off-by: you06 <you1474600@gmail.com> update client-go Signed-off-by: you06 <you1474600@gmail.com> update client-go Signed-off-by: you06 <you1474600@gmail.com> update grafana Signed-off-by: you06 <you1474600@gmail.com> update bazel Signed-off-by: you06 <you1474600@gmail.com> display by stack Signed-off-by: you06 <you1474600@gmail.com> set request source for ctx of Signed-off-by: you06 <you1474600@gmail.com> address comment Signed-off-by: you06 <you1474600@gmail.com> address comment Signed-off-by: you06 <you1474600@gmail.com> parser, ddl: support decoding binary literal in set/enum (pingcap#35822) close pingcap#31338 executor: fix a nil point when @@tidb_enable_collect_execution_info is off and cop cache is on (pingcap#35839) close pingcap#35829 ddl: support drop columns for multi-schema change (pingcap#35737) ref pingcap#14766 planner: don't push down predicates over table dual (pingcap#35669) close pingcap#35527 *: Remove some useless staleness code (pingcap#35849) close pingcap#35848 ddl: fix potential wrong column definition when setting default value (pingcap#35845) close pingcap#35846 *: add timeout for test cases (pingcap#35844) ddl: remove `onDropColumns` and `onAddColumns` (pingcap#35862) ref pingcap#14766 *: Fix Dockerfile (pingcap#35835) close pingcap#35828 server: refactor TestConnExecutionTimeout (pingcap#35865) close pingcap#35868 fix test Signed-off-by: you06 <you1474600@gmail.com> fix lint Signed-off-by: you06 <you1474600@gmail.com>
What problem does this PR solve?
Issue Number: close #31338
Problem Summary:
#31338 (comment):
What is changed and how it works?
After this PR, the enum/set values are saved by parser along with a flag, which is used to indicate that whether it is a binary literal:
In the stage of
buildTableInfo
, we decode column'sFieldType.elems
according to the column charset to UTF-8 values, and save it. Thus, the enum/set values are always valid UTF-8, nothing is truncated.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.