-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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: Make tidb_constraint_check_in_place session variable work for unique index #20939
Conversation
Please follow PR Title Format:
Or if the count of mainly changed packages are more than 3, use
|
7dfc140
to
3e647c0
Compare
/run-all-tests |
9e9d2e1
to
6bc17cc
Compare
/run-check_dev_2 |
/run-all-tests |
c60255f
to
bf1ab29
Compare
/run-check_dev_2 |
LGTM |
There is no reward for this challenge pull request, so you can request a reward from @tiancaiamao. |
/reward 600 |
This PR's linked issue is not picked. |
/run-all-tests |
1 similar comment
/run-all-tests |
/run-all-tests tidb-test=pr/1105 |
/run-check_dev_2 |
/run-check_dev_2 |
update unique is very likely to conflict, we should return error instantly. |
LGTM @coocood |
can we remove the modifications like
for other tests? |
/run-check_dev_2 |
executor/write_test.go
Outdated
@@ -1389,6 +1390,7 @@ func (s *testSuite8) TestUpdate(c *C) { | |||
|
|||
// Test that in a transaction, when a constraint failed in an update statement, the record is not inserted. | |||
tk.MustExec("create table update_unique (id int primary key, name int unique)") | |||
tk.MustExec("set @@tidb_constraint_check_in_place = 1") |
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.
Why do we need to change this test?
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.
There is no begin
keyword before the INSERT
statement, Is it running in auto-commit mode. ^_^
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.
auto-commit statements should return the same error or no error no mater tidb_constraint_check_in_place
is set to '0' or '1'.
Theoretically, if we only affect auto-commit statements, all the old tests should pass without any modification. |
PTAL @coocood |
LGTM |
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
/run-all-tests |
/run-check_dev_2 |
@xiaodong-ji, Congratulations, you get 600 in this PR, and your total score is 600 in hptc challenge program. |
What problem does this PR solve?
Issue Number: close #20484
What is changed and how it works?
How it Works: Set the value of the tidb_constraint_check_in_place parameter to 0.
Check List
Tests
Release note