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

MySQL doesn't allow mutliple updates on primary key #20594

Closed
dyzsr opened this issue Oct 22, 2020 · 2 comments · Fixed by #20603
Closed

MySQL doesn't allow mutliple updates on primary key #20594

dyzsr opened this issue Oct 22, 2020 · 2 comments · Fixed by #20603
Assignees
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@dyzsr
Copy link
Contributor

dyzsr commented Oct 22, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists t;
create table t (a int, b int, primary key (a, b));
insert into t (1, 2);
update t t1, t t2 set t1.a=t1.a+10, t2.b=t2.b+10;

2. What did you expect to see? (Required)

In MySQL 8.0.19

mysql> update t t1, t t2 set t1.a=t1.a+10, t2.b=t2.b+10;
ERROR 1706 (HY000): Primary key/partition key update is not allowed since the table is updated both as 't1' and 't2'.

3. What did you see instead (Required)

mysql> update t t1, t t2 set t1.a=t1.a+10, t2.b=t2.b+10;
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2  Changed: 2  Warnings: 0

4. What is your TiDB version? (Required)

mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                                                            |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v4.0.0-beta.2-1407-ge30220099
Edition: Community
Git Commit Hash: e302200999045d81b19d08d5ec240d3438674abb
Git Branch: master
UTC Build Time: 2020-10-22 11:32:06
GoVersion: go1.15
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
@dyzsr dyzsr added the type/bug The issue is confirmed as a bug. label Oct 22, 2020
@dyzsr dyzsr changed the title MySQL doesn't allow mutliple updates of primary key MySQL doesn't allow mutliple updates on primary key Oct 26, 2020
@SunRunAway
Copy link
Contributor

/label sig/execution

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants