This repository has been archived by the owner on Nov 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 188
syncer: fix the case-sensitive issue #1738
Merged
Merged
Changes from 41 commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
b17efdf
fix syncer case-sensitive issue
glorv a97d7a1
fix query
glorv ac53943
try to fix an unstable test
glorv ffee76b
fix unit test
glorv d7b3385
fix unit test
glorv fd6730e
add case-sensitive test
glorv 620336d
Merge branch 'case-sensitive' of ssh://github.com/glorv/dm into case-…
glorv 54bc9df
Merge branch 'case-sensitive' of ssh://github.com/glorv/dm into case-…
glorv af4f835
fmt test
glorv c8932f1
Merge branch 'case-sensitive' of ssh://github.com/glorv/dm into case-…
glorv 4813d88
update tidb-tools
glorv 3de549f
Merge branch 'master' of ssh://github.com/pingcap/dm into case-sensitive
glorv 1806894
Merge branch 'master' into case-sensitive
glorv b4009a3
fix go.sum
glorv 9ec36aa
Merge branch 'case-sensitive' of ssh://github.com/glorv/dm into case-…
glorv 2e867eb
use filter.Apply to avoid the case-sensitive bug
glorv e9ac965
don't allow case-sensitive when lower_case_table_names is 2
glorv 0d006b9
Merge branch 'master' of ssh://github.com/pingcap/dm into case-sensitive
glorv 1032aa4
fix etcd
glorv 8e4cf22
Merge branch 'master' of ssh://github.com/pingcap/dm into case-sensitive
glorv b9d96df
Merge branch 'master' of ssh://github.com/pingcap/dm into case-sensitive
glorv 0253709
Merge branch 'master' into case-sensitive
glorv 8e4b220
Merge branch 'master' of ssh://github.com/pingcap/dm into case-sensitive
glorv 42df851
Merge branch 'case-sensitive' of ssh://github.com/glorv/dm into case-…
glorv bc6cef0
fix lint
glorv 965554a
Merge branch 'master' into case-sensitive
glorv cdd92ed
fix integration test
glorv 849a94a
Merge branch 'case-sensitive' of ssh://github.com/glorv/dm into case-…
glorv a496a36
fix tiup test
glorv 9781bd3
use tmate v3
glorv 5afd04f
Merge branch 'master' of ssh://github.com/pingcap/dm into case-sensitive
glorv a27fb63
fix patch checkpoint logic and do not test optimist mode in tiup upgr…
glorv ea88a19
Merge branch 'master' of ssh://github.com/pingcap/dm into case-sensitive
glorv 0f03b4f
resolve comments
glorv 0faf9ea
address hound
glorv 56097a3
format code
glorv 60d8cff
Merge branch 'master' of ssh://github.com/pingcap/dm into case-sensitive
glorv 9a69456
fix typo
glorv 7bba670
fix integration test
glorv b4f4eeb
Merge branch 'master' of ssh://github.com/pingcap/dm into case-sensitive
glorv 997eb8b
Merge branch 'master' of ssh://github.com/pingcap/dm into case-sensitive
glorv 93191e1
Merge branch 'master' of ssh://github.com/pingcap/dm into case-sensitive
glorv 553049d
resolve comments
glorv 0a09c5b
fix typo
glorv 08aa33c
Merge branch 'master' into case-sensitive
ti-chi-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -344,3 +344,47 @@ func (oldInfo *OldInfo) toInfo() Info { | |||||
TableInfosAfter: []*model.TableInfo{oldInfo.TableInfoAfter}, | ||||||
} | ||||||
} | ||||||
|
||||||
// CheckDDLInfos try to check and fix all the schema and table names for DDL info. | ||||||
func CheckDDLInfos(cli *clientv3.Client, source string, schemaMap map[string]string, talesMap map[string]map[string]string) error { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
allInfos, _, err := GetAllInfo(cli) | ||||||
if err != nil { | ||||||
return err | ||||||
} | ||||||
|
||||||
for _, taskTableInfos := range allInfos { | ||||||
sourceInfos, ok := taskTableInfos[source] | ||||||
if !ok { | ||||||
lance6716 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
continue | ||||||
} | ||||||
for schema, tblInfos := range sourceInfos { | ||||||
realSchema, hasChange := schemaMap[schema] | ||||||
if !hasChange { | ||||||
realSchema = schema | ||||||
} | ||||||
|
||||||
tblMap := talesMap[schema] | ||||||
for tbl, info := range tblInfos { | ||||||
realTable, tableChange := tblMap[tbl] | ||||||
if !tableChange { | ||||||
realTable = tbl | ||||||
tableChange = hasChange | ||||||
} | ||||||
if tableChange { | ||||||
delOp := deleteInfoOp(info) | ||||||
info.UpSchema = realSchema | ||||||
info.UpTable = realTable | ||||||
putOp, err := putInfoOp(info) | ||||||
if err != nil { | ||||||
return err | ||||||
} | ||||||
_, _, err = etcdutil.DoOpsInOneTxnWithRetry(cli, delOp, putOp) | ||||||
if err != nil { | ||||||
return err | ||||||
} | ||||||
} | ||||||
} | ||||||
} | ||||||
} | ||||||
return nil | ||||||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Will this make a chaos test fail?
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.
Not sure 🤔