Skip to content
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

dumpling: add collation_compatible config in dumpling #31114

Merged

Conversation

WizardXiao
Copy link
Contributor

@WizardXiao WizardXiao commented Dec 29, 2021

What problem does this PR solve?

Issue Number: close #3420

Problem Summary:
See #3420.

What is changed and how it works?

add config collation_compatible in dumpling.
default loose handle create sql by original sql, will not add default collation as upstream.
strict will add default collation as upstream, and downstream will occur error when downstream don't support

Check List

Tests

  • Unit test

Documentation

  • Contains variable changes

Release note

add collation_compatible config in dumpling

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Dec 29, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Ehco1996
  • lichunzhu

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 29, 2021
@WizardXiao
Copy link
Contributor Author

/component dumpling

@ti-chi-bot ti-chi-bot added the component/dumpling This is related to Dumpling of TiDB. label Dec 29, 2021
@WizardXiao
Copy link
Contributor Author

/cc @lichunzhu @Ehco1996 @lance6716

@WizardXiao WizardXiao changed the title commit-message: add collation_compatible config in dumpling dumpling: add collation_compatible config in dumpling Dec 29, 2021
@sre-bot
Copy link
Contributor

sre-bot commented Dec 29, 2021

Copy link
Contributor

@lichunzhu lichunzhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to add a unit test/integration test for this method?

dumpling/export/config.go Outdated Show resolved Hide resolved
dumpling/export/config.go Outdated Show resolved Hide resolved
@WizardXiao
Copy link
Contributor Author

WizardXiao commented Dec 29, 2021

Maybe move collation_compatible judgement into adjustxxx will be easier to add ut. I will try. By the way, integration test will be added in tiflow repo together with increment.

Copy link
Contributor

@lichunzhu lichunzhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 29, 2021
@@ -443,7 +452,10 @@ func adjustDatabaseCollation(tctx *tcontext.Context, parser *parser.Parser, orig
}

// adjustTableCollation adjusts table collation
func adjustTableCollation(tctx *tcontext.Context, parser *parser.Parser, originSQL string, charsetAndDefaultCollationMap map[string]string) (string, error) {
func adjustTableCollation(tctx *tcontext.Context, collationCompatible string, parser *parser.Parser, originSQL string, charsetAndDefaultCollationMap map[string]string) (string, error) {
if collationCompatible != StrictCollationCompatible {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe do this check out of adjustTableCollation? not strong , current code lgtm too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, i do this like that before, but i find it is maybe hard to add UT for this config, because the judgement will be in dumpDatabases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, maybe we can enhance this later, because codefreeze is coming, i will merge this pr first

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Dec 29, 2021
@WizardXiao
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

@WizardXiao: /merge is only allowed for the committers, you can assign this pull request to the committer in list by filling /assign @committer in the comment to help merge this pull request.

In response to this:

/merge

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.

@WizardXiao
Copy link
Contributor Author

Please help merge this pr, if there is no other conversation. thank you. @lichunzhu

@Ehco1996
Copy link
Contributor

/run-integration-dumpling-test

@Ehco1996
Copy link
Contributor

Ehco1996 commented Dec 29, 2021

Please help merge this pr, if there is no other conversation. thank you. @lichunzhu

will merge this pr after dumpling it test passed

@Ehco1996
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: e3ef220

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 29, 2021
@WizardXiao
Copy link
Contributor Author

/run-check_dev_2

@WizardXiao
Copy link
Contributor Author

/run-unit-test

@WizardXiao
Copy link
Contributor Author

/run-check_dev_2

@ti-chi-bot
Copy link
Member

[FORMAT CHECKER NOTIFICATION]

Notice: Please provide the linked issue number on one line in the PR body, for example: Issue Number: close #123 or Issue Number: ref #456.

📖 For more info, you can check the "Contribute Code" section in the development guide.

@ti-chi-bot ti-chi-bot merged commit 1e7f0dc into pingcap:master Dec 29, 2021
@lance6716 lance6716 added the needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 label Jan 18, 2022
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jan 18, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-5.3 in PR #31777

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/dumpling This is related to Dumpling of TiDB. needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DM migrates table with incorrect collation
7 participants