-
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
planner: fix the bug that wrong collation is used when try fast path for enum or set #23217
Conversation
Signed-off-by: wjhuang2016 <[email protected]>
expression/integration_test.go
Outdated
tk.MustExec("drop table if exists t") | ||
tk.MustExec("create table t(c set('A', 'B') collate utf8mb4_general_ci);") | ||
tk.MustExec("insert into t values('a');") | ||
tk.MustQuery("select c from t1 where c = 'a';").Check(testkit.Rows("A")) |
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.
Here should be select c from t where c = 'a';
(table t
not the t1
)
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.
Please fix the CI problem:
[2021-03-09T11:40:22.369Z] FAIL: integration_test.go:6242: testIntegrationSerialSuite.TestCollationBasic
``` @wjhuang2016
expression/integration_test.go
Outdated
tk.MustExec("drop table if exists t") | ||
tk.MustExec("create table t(c set('A', 'B') collate utf8mb4_general_ci);") | ||
tk.MustExec("insert into t values('a');") | ||
tk.MustQuery("select c from t1 where c = 'a';").Check(testkit.Rows("A")) |
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.
Please add more test queries like this comment.
Signed-off-by: wjhuang2016 <[email protected]>
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
[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 writing |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 2d140c4
|
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-4.0 in PR #23292 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.0-rc in PR #23293 |
Signed-off-by: wjhuang2016 [email protected]
What problem does this PR solve?
Issue Number: close #23053
Problem Summary:
When comparing datum, we used the wrong collation.
CompareDatum uses the d's collation, which is wrong.
What is changed and how it works?
d.CompareDatum(stmtCtx, &dval) =>
dVal.CompareDatum(stmtCtx, &d)
Related changes
Check List
Tests
Side effects
Release note