You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: UPDATE IGNORE still errors on duplicate unique-key updates #25347
Existing issue #15345 covers INSERT IGNORE reporting errors for several incompatible rows. This issue is for UPDATE IGNORE: MySQL skips the duplicate-key update and keeps the row unchanged, while MatrixOne returns a duplicate-key error.
Branch Name
main
Commit ID
0e8602b78
Other Environment Information
Local MatrixOne built from latest origin/main
MySQL oracle: MySQL 8.0.45
Actual Behavior
UPDATE IGNORE still reports a duplicate unique-key error when the update would conflict with an existing unique key.
Observed on MatrixOne latest main:
ERROR 1062 (HY000): Duplicate entry '(b,x)' for key '(a,b)'
The data remains unchanged after the failed statement, but the statement should not error in MySQL-compatible IGNORE mode.
Expected Behavior
MySQL skips the conflicting update row and keeps it unchanged:
id a b
1 b x
2 NULL x
3 a x
Steps to Reproduce
DROPDATABASE IF EXISTS mysql_compat_update_ignore_min;
CREATEDATABASEmysql_compat_update_ignore_min;
USE mysql_compat_update_ignore_min;
CREATETABLEt (
id intprimary key,
a varchar(16) null,
b varchar(16) null,
unique key uq_ab(a,b),
index idx_ab(a,b,id)
);
INSERT INTO t VALUES (1,null,'x'),(2,null,'x'),(3,'a','x');
UPDATE t SET a='b', b='x'WHERE id=1;
UPDATE IGNORE t SET a='b', b='x'WHERE id=2;
SELECT id, a, b FROM t ORDER BY id;
Additional information
MySQL 8.0.45 result:
id a b
1 b x
2 NULL x
3 a x
MatrixOne latest main at 0e8602b78:
ERROR 1062 (HY000): Duplicate entry '(b,x)' for key '(a,b)'
This was found while backfilling Model 3 NULL / unique composite-index compatibility coverage. The case also exercises MySQL's rule that unique indexes permit multiple NULL values, then checks UPDATE IGNORE behavior when a later update would create a non-NULL duplicate key.
Activity
fix: honor UPDATE IGNORE on duplicate keys (#25706)
Ariznawlll commentedon Jul 15, 2026
最新 main 可复核验证(MOTR)
实际执行命令
f1c0a92d882dbdad469ffd2c96f607796207c797git_version()=f1c0a92d835/35 success,380/380条语句符合预期,0 failed。本 issue 实际用例
uq_ab(a,b)的表,并插入两个允许共存的(NULL,'x')。('b','x')。UPDATE IGNORE ... SET a='b',b='x',制造唯一键冲突。(NULL,'x');全表只有一行('b','x')。fix: honor UPDATE IGNORE on duplicate keys (matrixorigin#25706)
fix: honor UPDATE IGNORE on duplicate keys (matrixorigin#25706)
fix: honor UPDATE IGNORE on duplicate keys (matrixorigin#25706)