Repository navigation
Done
Labels
Description
Environment
- Branch:
4.2-dev - Commit:
6c05e42f9f660a207077b050b8ec285ccf3f8103(release candidate) - Also reproduced on PR [4.2-dev] fix: align ENUM/SET secondary-index key encoding #33152 head
16fd99fadd48f0912732b81681acf7b66b93c4a8, confirming this is not introduced by that PR - Deployment: local single-CN / single-TN / single-Log
mo-service, built from source - Hardware / OS: Apple Silicon (arm64), macOS
- Client: MySQL text protocol
Actual Behavior
An equality lookup through a composite secondary index containing an ENUM part fails with:
ERROR 20101 (HY000): internal error: not supported type ENUM
EXPLAIN selects the secondary index and produces a filter using cast_index_to_value over serial_extract(..., ENUM):
Project
-> Index Table Scan on t.ix
Filter Cond: prefix_eq(__mo_index_idx_col),
(serial_extract(__mo_index_idx_col, 0, VARCHAR)) = 'k'),
(cast_index_to_value('x,y', serial_extract(__mo_index_idx_col, 1, ENUM))) = 'x')
The same query shape and error occur on both the release candidate and PR #33152 head. A single-column ENUM secondary-index lookup works, so this report is specifically about the composite-index extraction path.
Expected Behavior
The query should return the matching row (id = 1) without an internal error.
Steps to Reproduce
create database enum_composite_lookup_42;
use enum_composite_lookup_42;
create table t (
id int primary key,
tag varchar(8),
e enum('x','y'),
key ix(tag,e)
);
insert into t values (1,'k','x'),(2,'k2','x');
explain select id from t where tag='k' and e='x';
select id from t where tag='k' and e='x';The final statement returns 20101 internal error: not supported type ENUM instead of 1.
Additional Information
- This was found while QA-challenging PR [4.2-dev] fix: align ENUM/SET secondary-index key encoding #33152 with a new black-box probe; it is independent of that PR's DELETE/UPDATE key-encoding fix.
- Related but not identical: [Bug]: binary prepared ENUM/YEAR covering-index queries fail with unsupported type #26873 covered binary-prepared covering-index queries and was fixed on
mainby fix: support enum and year in serial_extract #26943 (serial_extractENUM/YEAR result dispatch). The fix: support enum and year in serial_extract #26943 merge commit8c6ada2a58641046ee30f703c2473b4b02430792is not in4.2-dev. - This report is for the literal-query, composite-secondary-index path on 4.2-dev. Whether it needs the same extraction-dispatch backport or an additional composite-index fix still needs confirmation.
- Issue searches for
not supported type ENUM,serial_extract ENUM,cast_index_to_value, andcomposite ENUM indexfound no existing report for this exact branch/path combination.
Activity
XuPeng-SH commentedon Nov 25, 2026
Main control result
Built and tested
origin/mainat0b641a61f42ebfc53fd415ab68898cfc77682a2awith the same local single-CN setup and MySQL text protocol.The exact composite-index reproduction is not affected on main:
where tag='k' and e='x'returnedid = 1.where tag='k' and e in ('x','y')returnedid = 1, 3.force index(ix)returnedid = 1.use index()and single-column ENUM index controls also returned the expected rows.EXPLAINstill uses the samecast_index_to_value(... serial_extract(..., ENUM))plan shape, but execution succeeds. This scopes #33258 to4.2-devfor the tested path. PR #26943 is therefore a backport candidate; a 4.2 cherry-pick plus this reproduction should confirm whether it is sufficient before closing.[4.2-dev] fix: support ENUM and YEAR in serial_extract (#33260)
XuPeng-SH commentedon Nov 25, 2026
转 QA:#33260 已合入
4.2-dev,merge SHA4d846052dc4d78f3942a53da5f05668be9deb37b。补齐serial_extract的 ENUM/YEAR 类型分派,沿用现有编码与解码;回填后的 ENUM 索引依赖已合入的 #33152。最终 head
20b7c18b的 CI Required、x86 UT、悲观多 CN BVT 均通过;独立复审通过,沿用只有测试行差异的先前 head 的 28 项嵌入式 SQL 和函数包证据。没有覆盖发布升级或在最终合并版的独立 MySQL 复试,本轮未本地重跑。请在上述合并版本验证原复合索引 SELECT,补 YEAR、INSERT 时建索引及 ALTER 回填、普通及 binary-prepared 等值/IN、NULL、FORCE INDEX 与无索引对照;对发布版本已有索引按实际升级路径核对。原 #33080 DELETE/UPDATE 不混入本单。Ariznawlll commentedon Nov 26, 2026
已完成 4.2-dev 固定版本验收,结论:复合索引包含 ENUM 时查询返回
not supported type ENUM的问题已修复,可关闭本 Issue。版本与原始复现
4d846052dc4d78f3942a53da5f05668be9deb37b。8a273a0f81eda0290d431e54f7a0befe3bb752ec(同时包含 [4.2-dev] fix: align ENUM/SET secondary-index key encoding #33152);真实连接的git_version()已核实。c56af3c5f04cb6047769696917b428c2658566a3。t(id,tag,e ENUM,KEY ix(tag,e)),插入三行后执行SELECT id FROM t WHERE tag='k' AND e='x'。ERROR 20101: not supported type ENUM;同轮无索引查询返回(1),单列 ENUM 索引健康对照正常。id=1,不得因 ENUM 列报内部不支持错误。修复后实测
interpolateParams=false的真实 binary-prepared 三轮累计 38 项断言通过。TestIssue33258CompositeEnumAndYearIndexLookup普通及-race各三轮,均 3/3 PASS。MOTR CI 状态
3d085c8fb810453989044720dcb120e0f9bc46cc。latest-42-dual-cn仍在运行;未将双 CN CI 计为通过,也未等待其全绿后关闭。范围说明