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
[Compatibility]: IGNORE skips constraint violations without populating MySQL warnings #28254
MatrixOne correctly skips rows rejected by primary/unique keys and CHECK constraints under INSERT IGNORE or UPDATE IGNORE, but it leaves the statement warning area empty.
MySQL records one warning for each ignored row, preserving the original condition code. Without these warnings, a client sees only the reduced affected-row count and cannot determine which integrity rule caused data to be omitted.
This issue is limited to warning reporting for rows that are already skipped correctly; it is separate from value-conversion behavior under non-strict SQL modes.
createdatabasecodex_ignore_warning;
use codex_ignore_warning;
createtableuq(id intprimary key, v int unique);
insert into uq values(1,10);
insert ignore into uq values(1,11),(2,10),(3,30);
show warnings;
select*from uq order by id;
Both databases retain the same rows:
1 10
3 30
MatrixOne returns no warnings. MySQL returns:
Warning 1062 Duplicate entry '1' for key 'uq.PRIMARY'
Warning 1062 Duplicate entry '10' for key 'uq.v'
CHECK examples
createtableck(
id intprimary key,
v int,
constraint ck_pos check(v >0)
);
insert ignore into ck values(1,-1),(2,2),(3,-3);
show warnings;
update ignore ck set v=-v;
show warnings;
select*from ck order by id;
Both databases keep only (2,2). MatrixOne returns no warnings after either DML statement. MySQL returns two warning 3819 rows after the insert and one warning 3819 row after the update:
Warning 3819 Check constraint 'ck_pos' is violated.
Expected behavior
For every row skipped because IGNORE downgraded an integrity error, MatrixOne should populate the warning area with the original error code and a useful message, matching MySQL's observable warning semantics.
INSERT IGNORE and UPDATE IGNORE now expose warnings for rows skipped by
primary-key, unique-key, and CHECK constraint violations. The warning count is
one per skipped row, while SHOW WARNINGS retains the existing bounded
diagnostic set.
Design
Use one bounded warning accumulator per execution boundary. It preserves the
exact total count and at most 64 rendered diagnostics, then sends one batch
to the owning session.
Cover all production duplicate paths: hash-build deduplication,
dedup-join probing, and the multi-primary/unique-key PreInsertUnique
arbiter used by ordinary multi-key INSERT IGNORE.
Carry logical unique-key names and types in PreInsertUkCtx, so serialized
composite/index keys are rendered as user-visible values instead of
internal encodings.
Run CHECK assertions in IGNORE mode as a barrier filter: rejected rows are
removed, but the assertion records ER_CHECK_CONSTRAINT_VIOLATED warnings.
Correctness and unhappy paths
Diagnostics are flushed only after the operator/function completes
successfully; cancellation, encoding failure, or another statement error
cannot leak partial warnings into a later statement.
A row that conflicts with multiple constraints produces one duplicate
warning for the first constraint selected by the existing arbitration order.
After the 64-record retention limit, key rendering stops but the exact total
count continues to be accumulated, avoiding unbounded memory and formatting
work.
Diagnostic rendering is best-effort and cannot turn an already-ignored row
into a statement failure. Legacy/cached plans without the new metadata use a
safe fallback name.
Internal dedup operations are not changed unless they belong to a statement
carrying IGNORE semantics.
Validation
go test -count=1 ./pkg/vm/process ./pkg/sql/colexec/preinsertunique ./pkg/sql/colexec/hashbuild ./pkg/sql/colexec/dedupjoin ./pkg/sql/plan ./pkg/sql/plan/function ./pkg/sql/compile
go test -race -count=1 ./pkg/vm/process ./pkg/sql/colexec/preinsertunique
Local MatrixOne BVT for issue_28254_ignore_warnings.test: 30/30 checks
passed in each of 3 runs, covering existing and same-batch PK/unique
duplicates, ordinary single-PK deduplication, UPDATE IGNORE, and CHECK
violations. The mo-tester wrapper exits non-zero afterward because its
report-move step cannot find report/*.txt; the three execution summaries
are all 100% with zero failed or abnormal cases.
git diff --check
The full repository CI has not been waited on locally.
Activity
XuPeng-SH commentedon Sep 9, 2026
Summary
Fixes #28254.
INSERT IGNOREandUPDATE IGNOREnow expose warnings for rows skipped byprimary-key, unique-key, and CHECK constraint violations. The warning count is
one per skipped row, while
SHOW WARNINGSretains the existing boundeddiagnostic set.
Design
exact total count and at most 64 rendered diagnostics, then sends one batch
to the owning session.
dedup-join probing, and the multi-primary/unique-key
PreInsertUniquearbiter used by ordinary multi-key
INSERT IGNORE.PreInsertUkCtx, so serializedcomposite/index keys are rendered as user-visible values instead of
internal encodings.
removed, but the assertion records
ER_CHECK_CONSTRAINT_VIOLATEDwarnings.Correctness and unhappy paths
successfully; cancellation, encoding failure, or another statement error
cannot leak partial warnings into a later statement.
warning for the first constraint selected by the existing arbitration order.
count continues to be accumulated, avoiding unbounded memory and formatting
work.
into a statement failure. Legacy/cached plans without the new metadata use a
safe fallback name.
carrying IGNORE semantics.
Validation
go test -count=1 ./pkg/vm/process ./pkg/sql/colexec/preinsertunique ./pkg/sql/colexec/hashbuild ./pkg/sql/colexec/dedupjoin ./pkg/sql/plan ./pkg/sql/plan/function ./pkg/sql/compilego test -race -count=1 ./pkg/vm/process ./pkg/sql/colexec/preinsertuniqueissue_28254_ignore_warnings.test: 30/30 checkspassed in each of 3 runs, covering existing and same-batch PK/unique
duplicates, ordinary single-PK deduplication,
UPDATE IGNORE, and CHECKviolations. The mo-tester wrapper exits non-zero afterward because its
report-move step cannot find
report/*.txt; the three execution summariesare all 100% with zero failed or abnormal cases.
git diff --checkThe full repository CI has not been waited on locally.
fix: report INSERT IGNORE constraint warnings (#28459)
Ariznawlll commentedon Sep 11, 2026
测试版本
4a7bfac4f91fe3e4519e25ed82654556e38d670a。7013fbbd6e152ba31da2d3dbba7012ac7f8b8462,本地 2 CN、1 TN、1 Log 拓扑;修复提交065a67528608c475d0219e0be6b7d454a58f7b1a已包含,且为上述官方 main 基线祖先。原问题验证
围绕
INSERT IGNORE与UPDATE IGNORE的约束违规路径复测,确认被跳过的行会保留 MySQL 兼容警告,且不会写入或改写非法数据。Happy Path 覆盖
(1,10)后,批量INSERT IGNORE中的合法行(3,30)成功写入。(1,10)、(3,30),证明合法行和被跳过行的行为可区分。Unhappy Path 覆盖
SHOW WARNINGS分别返回 1062 与 3819,非法行不落库。UPDATE IGNORE将值改为负数时返回 3819,原行(1,10)保持不变。白盒验证
本 issue 为 SQL 兼容性行为,使用可观察的
SHOW WARNINGS、最终行集与错误码进行黑盒验收;无额外内部状态断言。回归测试
14_issue_regression.issue_28254_ignore_warnings。./motr --repeat 3 --do-test '14_issue_regression\.issue_(28254|28233|28042)_.*' -v。测试证据
14_issue_regression运行中,本用例通过;其余 6 个既有用例的预期差异与本改动无关,未修改其基线。测试结论
测试通过。
fix: report INSERT IGNORE constraint warnings (matrixorigin#28459)
fix: report INSERT IGNORE constraint warnings (matrixorigin#28459)
fix: report INSERT IGNORE constraint warnings (matrixorigin#28459)