planner: fix the bug that wrong collation is used when try fast path for enum or set#23217
Conversation
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.
Here should be select c from t where c = 'a';(table t not the t1)
qw4990
left a comment
There was a problem hiding this comment.
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.
Please add more test queries like this comment.
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
|
[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 writing |
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 2d140c4 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
|
cherry pick to release-4.0 in PR #23292 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
|
cherry pick to release-5.0-rc in PR #23293 |
Signed-off-by: wjhuang2016 huangwenjun1997@gmail.com
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