-
Notifications
You must be signed in to change notification settings - Fork 188
*: read downstream table before CREATE TABLE to fix IF NOT EXISTS #1915
*: read downstream table before CREATE TABLE to fix IF NOT EXISTS #1915
Conversation
@@ -252,11 +252,11 @@ function DM_027_CASE() { | |||
run_sql_source1 "insert into ${shardddl1}.${tb2} values (4)" | |||
run_sql_source1 "insert into ${shardddl1}.${tb3} values (5,6)" | |||
# we now haven't checked table struct when create sharding table | |||
# there should be a error message like "Unknown column 'val' in 'field list'", "unknown column val" | |||
# but different TiDB version output different message. so we only roughly match here | |||
# and we'll attach IF NOT EXISTS to every CREATE TABLE and fetch downstream table first, so downstream table strcuture |
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.
this will cause CREATE TABLE in upstream becomes ineffective when downstream has already contained that table
When downstream table has same column with upstream one, this PR imtroduced more correctness for genearting WHERE
When downstream table has less column, this PR changes error message from "unknown column" to "column value mismatch"
When downstream table has more column, this PR will break the synchronizing with error "Column count doesn't match value count"
/run-all-tests |
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 submitting an approval review. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: dcae369
|
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
/merge |
In response to a cherrypick label: new pull request created: #1919. |
What problem does this PR solve?
revert some of #1699
What is changed and how it works?
as title, we read downstream table from checkpoint/etcd/SHOW CREATE TABLE first, to deal with IF NOT EXISTS.
in future we'll change to a better strategy.
Check List
Tests
Code changes
Side effects
Related changes