-
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
ddl: fix expression index with insert causes losing index data #26248
Conversation
Please follow PR Title Format:
Or if the count of mainly changed packages are more than 3, use
|
Please follow PR Title Format:
Or if the count of mainly changed packages are more than 3, use
|
7f9764d
to
d2c3f19
Compare
Please follow PR Title Format:
Or if the count of mainly changed packages are more than 3, use
|
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.
Rest LGTM
ddl/db_test.go
Outdated
if job.SchemaState == model.StateDeleteOnly { | ||
if checkErr != nil { | ||
return | ||
} |
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.
We can put line416-418 after line412, then we can remove this check after every case state
.
ddl/db_test.go
Outdated
_, checkErr = tk1.Exec("insert into t1 values (2, 2, 2)") | ||
if checkErr != nil { | ||
return | ||
} | ||
_, checkErr = tk1.Exec("update t1 set c1 = 3 where c2 = 80") | ||
if checkErr != nil { | ||
return | ||
} |
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.
_, checkErr = tk1.Exec("insert into t1 values (2, 2, 2)") | |
if checkErr != nil { | |
return | |
} | |
_, checkErr = tk1.Exec("update t1 set c1 = 3 where c2 = 80") | |
if checkErr != nil { | |
return | |
} | |
_, checkErr = tk1.Exec("insert into t1 values (2, 2, 2)") | |
if checkErr == nil { | |
_, checkErr = tk1.Exec("update t1 set c1 = 3 where c2 = 80") | |
} |
ddl/db_test.go
Outdated
if job.SchemaState == model.StateDeleteOnly { | ||
switch job.SchemaState { | ||
case model.StateDeleteOnly: | ||
if job.SchemaState == model.StateDeleteOnly { |
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 if
statement is duplicated with line414.
if checkErr != nil { | ||
return | ||
} | ||
_, checkErr = tk1.Exec("delete from t1 where c1 = 40;") |
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.
Could we add insert and update statements here? This schema state will be running two times.
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
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: 322620f
|
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #26478 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.0 in PR #26479 |
Signed-off-by: wjhuang2016 huangwenjun1997@gmail.com
What problem does this PR solve?
Issue Number: close #26213
Problem Summary:
In reorg, we can't get the value of the hidden virtual column, then the index values are wrong.
What is changed and how it works?
For the hidden virtual column, the state is changed from none to public directly.
Check List
Tests
Side effects
Documentation
Release note