matrixorigin / matrixone

Hyperconverged cloud-edge native database
https://docs.matrixorigin.cn/en
Apache License 2.0
1.79k stars 277 forks source link

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

Open ouyuanning opened 5 months ago

ouyuanning commented 5 months ago

Is there an existing issue for the same bug?

Branch Name

main

Commit ID

a3b213989c316e5fdea8bdc21c3899626c53a7ef

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 commented 4 months ago

暂时处理不了。要等新的算子

ouyuanning commented 3 days ago

待高斌和龙冉确认排期

ouyuanning commented 12 hours ago

待高斌和龙冉确认排期