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

[Bug]: Replace with duplicate key should not throw error #16566

Closed
1 task done
ouyuanning opened this issue May 31, 2024 · 5 comments
Closed
1 task done

[Bug]: Replace with duplicate key should not throw error #16566

ouyuanning opened this issue May 31, 2024 · 5 comments
Assignees
Labels
kind/bug Something isn't working long-term-job severity/s0 Extreme impact: Cause the application to break down and seriously affect the use
Milestone

Comments

@ouyuanning
Copy link
Contributor

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

a3b2139

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

Replace into ... with duplicate key will throw error in MO

Expected Behavior

No response

Steps to Reproduce

select mo_ctl('cn', 'task', 'disable');
drop database if exists db1;
create database db1;
use db1;
create table t1(a int primary key, b int);
replace into t1 values (1,1),(1,2);    --  mysql have no error,  insert one row.  mo throw error: 

--- mysql:
mysql> replace into t1 values (1,1),(1,2);
Query OK, 3 rows affected (0.00 sec)
Records: 2  Duplicates: 1  Warnings: 0

mysql> select * from t1;
+---+------+
| a | b    |
+---+------+
| 1 |    2 |
+---+------+
1 row in set (0.00 sec)


---- mo
mysql> create table t1(a int primary key, b int);
Query OK, 0 rows affected (0.02 sec)

mysql> replace into t1 values (1,1),(1,2);
ERROR 1062 (HY000): Duplicate entry '1' for key 'a'

Additional information

No response

@ouyuanning ouyuanning added kind/bug Something isn't working needs-triage severity/s0 Extreme impact: Cause the application to break down and seriously affect the use labels May 31, 2024
@ouyuanning ouyuanning added this to the 1.3.0 milestone May 31, 2024
@ouyuanning ouyuanning self-assigned this May 31, 2024
@ouyuanning ouyuanning reopened this Jun 5, 2024
@ouyuanning ouyuanning added severity/s1 High impact: Logical errors or data errors that must occur and removed severity/s0 Extreme impact: Cause the application to break down and seriously affect the use labels Jun 18, 2024
@sukki37 sukki37 added severity/s0 Extreme impact: Cause the application to break down and seriously affect the use and removed severity/s1 High impact: Logical errors or data errors that must occur labels Oct 19, 2024
@sukki37 sukki37 modified the milestones: 2.0.0, 2.1.0 Oct 19, 2024
@ouyuanning
Copy link
Contributor Author

待高斌和龙冉确认排期

@ouyuanning
Copy link
Contributor Author

后面辛苦龙冉处理吧

@aunjgr
Copy link
Contributor

aunjgr commented Nov 21, 2024

等下一个版本重构

@aunjgr
Copy link
Contributor

aunjgr commented Nov 26, 2024

等重构

@aunjgr
Copy link
Contributor

aunjgr commented Jan 29, 2025

之前經討論確認,MO的replace行爲是,如果新增數據本身主鍵衝突,則報錯。所以重構之後,還是會保持這個行爲。

@aunjgr aunjgr assigned ouyuanning and unassigned aunjgr Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working long-term-job severity/s0 Extreme impact: Cause the application to break down and seriously affect the use
Projects
None yet
Development

No branches or pull requests

4 participants