-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
executor, planner: fix collation for hash join building #23770
Conversation
executor/builder.go
Outdated
@@ -2358,6 +2358,8 @@ func (b *executorBuilder) buildIndexLookUpJoin(v *plannercore.PhysicalIndexJoin) | |||
if innerTypes[i].EvalType() == types.ETString { | |||
innerTypes[i].Flen = types.UnspecifiedLength | |||
} | |||
// Use the probe table's collation. | |||
outerTypes[i].Collate = innerTypes[i].Collate |
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.
Do we need to deriveCollation here?
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.
No, we must use the probe table's collation.
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.
By the way, it causes Panic: index out of range.
We need to modify |
013cbf5
to
1b1fe43
Compare
/lgtm |
This test need to add a [2021-04-01T09:21:18.951Z] FAIL: integration_test.go:9003: testIntegrationSerialSuite.TestCollationPrefixClusteredIndex
[2021-04-01T09:21:18.951Z]
[2021-04-01T09:21:18.951Z] integration_test.go:9009:
[2021-04-01T09:21:18.951Z] tk.MustExec("create table t (k char(20), v int, primary key (k(4)) clustered, key (k)) collate utf8mb4_general_ci;")
[2021-04-01T09:21:18.951Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:217:
[2021-04-01T09:21:18.951Z] tk.c.Assert(err, check.IsNil, check.Commentf("sql:%s, %v, error stack %v", sql, args, errors.ErrorStack(err)))
[2021-04-01T09:21:18.951Z] ... value *errors.withStack = [schema:1050]Table 'test.t' already exists ("[schema:1050]Table 'test.t' already exists") |
[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 |
/run-all-tests |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 03b3f08
|
/merge |
1 similar comment
/merge |
@zhouqiang-cl: In 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. |
1d4c780
to
e0fe15d
Compare
Merge canceled because a new commit is pushed. |
@wjhuang2016: 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. 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. |
/run-all-tests |
/lgtm |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #23812 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.0 in PR #23813 |
What problem does this PR solve?
Issue Number: close #23693
Problem Summary:
outerHashKeys[i].GetType().Charset, outerHashKeys[i].GetType().Collate = chs, coll
collate is modified here, when building the merge join, the collate is wrong.
What is changed and how it works?
Correct the collation in the executor.
Related changes
Check List
Tests
Side effects
Release note