Repository navigation
Closed
Labels
Description
Existing issue check
- This is the same behavior as the closed main-branch issue [Bug]: grouped ENUM and SET values lose numeric ordinal semantics #28687, fixed by PR fix(plan): preserve grouped ENUM/SET numeric semantics #28751 (
afe0f1a755965f529745b93608ee766c78b2e6b5). - On
4.2-devtipb97995b007051b28d0f98bffc6f210da0aa9b866,git merge-base --is-ancestor afe0f1a755965f529745b93608ee766c78b2e6b5 b97995b007051b28d0f98bffc6f210da0aa9b866returns1, so the main fix is not in this branch. - The same failure also reproduces at earlier
4.2-devcommitcc056261a8fb977aeaffec3bea4bbd85a342fdca; this is not a regression introduced in the last 24 hours. This issue tracks the still-affected4.2-devbranch.
Branch Name
4.2-dev
Commit ID
b97995b007051b28d0f98bffc6f210da0aa9b866
Other Environment Information
- macOS arm64
- Fresh local deployment: 1 CN, 1 TN, 1 LogService
- SQL executed through the MySQL TCP protocol against the real
mo-service - Build toolchain recorded by the build: Go 1.26.4
Steps to Reproduce
DROP DATABASE IF EXISTS issue_group_42;
CREATE DATABASE issue_group_42;
USE issue_group_42;
CREATE TABLE t(
id INT PRIMARY KEY,
e ENUM('a','b'),
s SET('x','y')
);
INSERT INTO t VALUES
(1,'a','x'),
(2,'a','x,y'),
(3,'b','y');
-- Control: row-level numeric semantics work.
SELECT id,e,e+0,s,s+0 FROM t ORDER BY id;
-- Each of these grouped queries fails independently.
SELECT e+0 AS ord,COUNT(*) AS cnt FROM t GROUP BY e ORDER BY e+0;
SELECT s+0 AS bits,COUNT(*) AS cnt FROM t GROUP BY s ORDER BY s+0;The control returns the expected numeric values:
id e e+0 s s+0
1 a 1 x 1
2 a 1 x,y 3
3 b 2 y 2
Actual Behavior
The grouped ENUM query fails:
ERROR 20203 (HY000): invalid argument cast to int, bad value a
The grouped SET query fails independently:
ERROR 20203 (HY000): invalid argument cast to int, bad value x
There is no declared empty ENUM label, so this is not the deliberately excluded ambiguous-empty-label case described in PR #28751.
Expected Behavior
Numeric conversion after grouping must preserve the same ENUM ordinal and SET bitmap semantics as row-level conversion:
-- ENUM
ord cnt
1 2
2 1
-- SET
bits cnt
1 1
2 1
3 1
Additional information
- Closed main issue: [Bug]: grouped ENUM and SET values lose numeric ordinal semantics #28687
- Main fix: PR fix(plan): preserve grouped ENUM/SET numeric semantics #28751, merge commit
afe0f1a755965f529745b93608ee766c78b2e6b5 - The grouped output appears to lose the original ENUM/SET numeric provenance and attempts to convert the visible labels (
a/x) directly to integers. This is a behavioral observation consistent with [Bug]: grouped ENUM and SET values lose numeric ordinal semantics #28687; no new root-cause claim is made here.
Activity
XuPeng-SH commentedon Nov 16, 2026
Cross-version verification using the same standalone SQL against freshly built, real
mo-serviceinstances (MySQL protocol, fresh data directories):v4.2.810d204b8763f19b2b37ba2147d1d4c1a7828d6d4a; grouped SET fails on labelx. Row-levele+0/s+0works.4.2-devb97995b007051b28d0f98bffc6f210da0aa9b866origin/mainf491aaab4519b29313c5747d3ce3b3f84e865c71(ord=1,cnt=2),(2,1); SET returns(bits=1,cnt=1),(2,1),(3,1).The current main fix is effective. This is also present in released
v4.2.8; it is not only a regression on the newest4.2-devcommits.[4.2] Fix grouped ENUM and SET numeric conversions (#32823)
[4.2] Fix correlated scalar and grouped ENUM/SET conversions (#32841)
XuPeng-SH commentedon Nov 17, 2026
QA 交接(4.2-dev,不代表验收通过)
#32841 已于 2026-11-17 09:19:27 UTC 合入 4.2-dev,merge SHA
8c77e14665f054b9065a1cc2789017f7b9fc98c5。本 issue 的 grouped ENUM/SET 数值来源语义修复交 @Ariznawlll 验证,保持 open。已核 issue 全部评论及关联修复讨论;main 早已修复不等于 release 当时已修复,现在以本次 release merge 为依据。作者报告真实服务 grouped ENUM/SET BVT 84/84 两轮、扩展 scalar correlated BVT 89/89 两轮、plan/直接消费者测试及静态检查通过。旧 repeated NOW/CURRENT_DATE 反例随后由 5265c9 修复,后续审查明确关闭该发现并独立执行单 CN SQL;不把旧 head 反例当最终 head 反例。本次巡检未本地执行测试,未宣称多 CN/原现场全量验收。
请核对 issue 原 SQL 的 ENUM ordinal、SET bitmap、分组前后数值一致性及 NULL/非可逆转换、prepared 重复执行;关联 scalar 改动应核空结果 NULL、基数和稳定函数复用。nested no-FROM scalar numeric arithmetic 仍是独立的基线限制,不声称本 PR 一并修复。#32823 也是此 issue 的 release 关联记录,本次按 issue 去重只交接一次。
Ariznawlll commentedon Nov 18, 2026
QA 复验通过,按验收范围关闭。
环境:4.2-dev @
72c43e9305d8355c940075e414f30eaf2e4112a6(含修复 #32841,merge8c77e14,亦含同源 #32823),实例内git_version()确认。验证(MOTR 用例
issue_32819_grouped_enum_set_numeric,record 2/2 + verify 2/2 PASS):交付:https://github.com/matrixorigin/motr/pull/359(commit 0c75105)。