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]: utf8mb4_0900_ai_ci string comparison and REGEXP are case-sensitive #25239
For a case-insensitive collation such as utf8mb4_0900_ai_ci, string equality and REGEXP matching should follow MySQL's case-insensitive comparison semantics. The trailing-space equality result 0 is already aligned for this collation.
Additional validation on latest main (200bfa7e0efb) shows the same collation issue also affects explicit COLLATE expressions beyond scalar equality / REGEXP.
MySQL oracle:
select
_utf8mb4'a' collate utf8mb4_bin = _utf8mb4'A' collate utf8mb4_bin as bin_eq_case,
_utf8mb4'a' collate utf8mb4_general_ci = _utf8mb4'A' collate utf8mb4_general_ci as ci_eq_case,
_utf8mb4'a ' collate utf8mb4_bin = _utf8mb4'a' collate utf8mb4_bin as bin_eq_trailing,
_utf8mb4'a ' collate utf8mb4_general_ci = _utf8mb4'a' collate utf8mb4_general_ci as ci_eq_trailing;
select
strcmp(_utf8mb4'a' collate utf8mb4_bin, _utf8mb4'A' collate utf8mb4_bin) as strcmp_bin_case,
strcmp(_utf8mb4'a' collate utf8mb4_general_ci, _utf8mb4'A' collate utf8mb4_general_ci) as strcmp_ci_case,
strcmp(_utf8mb4'a ' collate utf8mb4_general_ci, _utf8mb4'a' collate utf8mb4_general_ci) as strcmp_ci_trailing;
createtablet_collate_expr (
id intprimary key,
s varchar(20) character set utf8mb4 collate utf8mb4_bin
);
insert into t_collate_expr values
(1, 'apple'), (2, 'Apple'), (3, 'APPLE'),
(4, 'banana'), (5, 'Banana'), (6, 'BANANA');
select id, s
from t_collate_expr
where s collate utf8mb4_general_ci = _utf8mb4'apple'order by id;
select distinct s collate utf8mb4_general_ci as ci_s
from t_collate_expr
order by ci_s;
select s collate utf8mb4_general_ci as ci_s, count(*) as c
from t_collate_expr
group by ci_s
order by ci_s;
MySQL collapses case variants under utf8mb4_general_ci, while MO keeps them distinct. I am not opening a separate issue for this because it appears to be the same collation-semantic gap tracked here.
Closing as consolidated under #25096. This report adds the session SET NAMES/connection-collation and default REGEXP_* cases to the existing end-to-end collation workstream. Those execution paths remain separate regression cases; this is administrative tracking consolidation, not a fix. The original reproductions and results remain here.
Activity
Ariznawlll commentedon Jul 1, 2026
Additional validation on latest
main(200bfa7e0efb) shows the same collation issue also affects explicitCOLLATEexpressions beyond scalar equality /REGEXP.MySQL oracle:
MySQL returns:
MO returns:
Table-path checks show the same root behavior:
MySQL collapses case variants under
utf8mb4_general_ci, while MO keeps them distinct. I am not opening a separate issue for this because it appears to be the same collation-semantic gap tracked here.add mysql compatibility type conversion and comparison bvt cases (#25219
daviszhen commentedon Aug 3, 2026
不需要为了这三条“纯字符串字面量” SQL 一次性完整实现所有 collation;但也绝不能只补 SET NAMES 或用 strings.EqualFold 打补丁。需要的是一个覆盖 utf8mb4_0900_ai_ci 的端到端最小 collation 语义链路。
即使做了, 还是半成品. 还不如完整支持呢
add mysql compatibility type conversion and comparison bvt cases (mat…
add mysql compatibility type conversion and comparison bvt cases (mat…
add mysql compatibility type conversion and comparison bvt cases (mat…
Ariznawlll commentedon Oct 14, 2026
补充
REGEXP_LIKE/INSTR/SUBSTR/REPLACE默认大小写语义。MatrixOne 本地 runtime8.0.30-MatrixOne-v1.3.0(source commit2ce4e58af6f03b943ee288ffad81012766cf830a)与隔离 MySQL8.0.45对照,3 次独立执行一致:REGEXP_LIKEciREGEXP_INSTRREGEXP_SUBSTRREGEXP_REPLACEutf8mb4_0900_ai_ciAXbc@@collation_connection=default)NULLAbc显式大小写控制
c/i两端一致;差异集中在未指定 match type 时,MySQL 从默认非二进制 collation 得到不区分大小写匹配,MO 默认按大小写敏感匹配。REGEXP_LIKE、REGEXP_INSTR、REGEXP_SUBSTR、REGEXP_REPLACE是同一 collation/default-match-type 缺口的不同入口,归入本 issue,不另开重复 issue。MySQL 文档:Regular Expressions。
XuPeng-SH commentedon Oct 23, 2026
Closing as consolidated under #25096. This report adds the session
SET NAMES/connection-collation and defaultREGEXP_*cases to the existing end-to-end collation workstream. Those execution paths remain separate regression cases; this is administrative tracking consolidation, not a fix. The original reproductions and results remain here.