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]: Backport ENUM/SET DELETE key handling to 4.2 to stop silently skipped DELETEs #33080
#29188 tracked the same DELETE failure on main and is closed after #29198. The failing secondary ENUM index path remains reproducible on 4.2. This issue tracks the 4.2 backport and its acceptance.
Published Linux x86_64 v4.2.8-hotfix-20261119, 5c16f56639acfc07ded01831c49c9bdec8e61125
The original 4.2.8 GA qualification also found the target row still readable after DELETE and restart on a composite ENUM index fixture.
Minimal reproduction
CREATEDATABASEenum_secondary_delete_42;
USE enum_secondary_delete_42;
CREATETABLEt (id INTPRIMARY KEY, e ENUM('red','green','blue'), KEY ix(e));
INSERT INTO t VALUES (2,'green');
DELETEFROM t WHERE id=2;
SELECT id,e FROM t WHERE id=2;
Expected: DELETE affects one row and the SELECT returns zero rows.
Actual: DELETE returns success with zero affected rows and the SELECT returns (2,'green'). With a composite index KEY ix(tag,e), the same symptom persisted after flushing the table and reading it from the other CN. The candidate's controls with an integer indexed column, or an ENUM column outside the index, deleted exactly one row.
Planner evidence and intended backport
On the candidate, EXPLAIN DELETE shows the base-table lookup and a hidden-index INNER JOIN with __mo_index_idx_col = serial_full(t.e, t.id). #29188 documents the storage/display mismatch: DELETE supplies the displayed label for the join while INSERT serialized the typed ordinal. Main's fix is #29198, commit 1a24bdbc7f. Port the relevant typed-expression handling to 4.2's DELETE binder.
Verify affected rows as well as the base-row and index lookup after commit. Cover single-column and composite non-unique indexes, and check the ENUM primary/unique and SET cases documented in #29188 alongside the proposed backport.
Additional release qualification on one (ENUM, INT) secondary index. Using a v4.2.9 data directory, the table populated before ADD INDEX and flush had DELETE-by-PK affect one row on v4.2.9 but zero rows on the upgraded build before index rebuild. A control table whose index existed before insert showed zero on v4.2.9 and one after upgrade. The comparison rolled the DELETE transactions back to keep the original rows available.
On the upgraded binary a DROP/ADD rebuild restored deletion on the affected sample. Rolling that rebuilt data directory back to v4.2.9 then produced zero affected rows on both samples. This is concrete coverage of the offline index migration and rollback boundary in docs/cn/enum_set_index_upgrade_42.md; the sample covers the tested ENUM layout.
Activity
[4.2-dev] fix: align ENUM/SET secondary-index key encoding (#33152)
XuPeng-SH commentedon Nov 25, 2026
转测:#33152 已合入
4.2-dev,merge SHA5fe5d2a54a101e5a143ce70bd9ca91ab0506ae36。最终16fd99fa的 CI Required、x86 UT、覆盖率和多 CN BVT 通过。独立复审通过有符号浮点零重复键、ENUM/SET 表示、公开序列化和 UPDATE owner 冲突的定向用例;本轮未自行重跑。请在合并版本复验原 DELETE(单列、复合索引及 FLUSH 后异 CN 观察),兼查影响行数、主表与隐藏索引一致性及 UPDATE 改主键。历史索引/恢复应按批准的停机隔离、盘点、重建和校验规程单独核验,不能视作原生历史 PITR 已通过。#33258 是发布候选也存在的复合索引 SELECT 路径问题,另单跟踪,不将它算作此次 DELETE/UPDATE 修复。
Ariznawlll commentedon Nov 26, 2026
已完成 4.2-dev 固定版本验收,结论:ENUM/SET 二级索引表 DELETE 被静默跳过的问题已修复,可关闭本 Issue。
版本与原始复现
5fe5d2a54a101e5a143ce70bd9ca91ab0506ae36。8a273a0f81eda0290d431e54f7a0befe3bb752ec(同时包含 [4.2-dev] fix: support ENUM and YEAR in serial_extract #33260);真实连接的git_version()已核实。21f38a48f7b7a0e3c89f9194f71f5691e5148b75。DELETE FROM ... WHERE id=2,检查影响行数并回读目标行。修复后实测
TestIndexBackfillPreservesPublicSerial普通及-race各三轮,均 3/3 PASS。MOTR CI 状态
3d085c8fb810453989044720dcb120e0f9bc46cc。latest-42-dual-cn仍在运行;未将双 CN CI 计为通过,也未等待其全绿后关闭。范围说明
LeftHandCold commentedon Dec 2, 2026
Additional release qualification on one
(ENUM, INT)secondary index. Using a v4.2.9 data directory, the table populated before ADD INDEX and flush had DELETE-by-PK affect one row on v4.2.9 but zero rows on the upgraded build before index rebuild. A control table whose index existed before insert showed zero on v4.2.9 and one after upgrade. The comparison rolled the DELETE transactions back to keep the original rows available.On the upgraded binary a DROP/ADD rebuild restored deletion on the affected sample. Rolling that rebuilt data directory back to v4.2.9 then produced zero affected rows on both samples. This is concrete coverage of the offline index migration and rollback boundary in
docs/cn/enum_set_index_upgrade_42.md; the sample covers the tested ENUM layout.