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]: GROUP_CONCAT truncation does not emit MySQL warning 1260 #28252
GROUP_CONCAT silently truncates its result at group_concat_max_len in MatrixOne, but SHOW WARNINGS contains no warning. MySQL reports warning 1260 (Row ... was cut by GROUP_CONCAT()) for each truncated aggregate instance.
This leaves clients unable to distinguish a complete aggregate result from a value silently shortened by the session limit.
createdatabasecodex_group_concat_warning;
use codex_group_concat_warning;
createtableg(id intprimary key, v varchar(20));
insert into g values (1,'éé'),(2,'中中'),(3,'abcd');
set session group_concat_max_len=8;
select group_concat(v order by id separator '|'),
hex(group_concat(v order by id separator '|'))
from g;
show warnings;
Both databases return the same well-formed 8-byte truncated value:
éé|中 C3A9C3A97CE4B8AD
MatrixOne returns no rows from SHOW WARNINGS.
MySQL returns warning 1260 for both truncated GROUP_CONCAT instances:
Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
The same omission occurs when the aggregate is executed through a prepared statement.
Expected behavior
When GROUP_CONCAT truncates a result because of group_concat_max_len, MatrixOne should expose a warning equivalent to MySQL warning 1260 so callers can detect the data loss.
Activity
fix(sql): report group concat truncation warnings (#28504)
Ariznawlll commentedon Sep 10, 2026
测试版本
main2b250abbc74b4443a2776655b2004bb9dc94ebe3原问题验证
将
group_concat_max_len设为8,对éé、中中、abcd执行两个独立的截断GROUP_CONCAT聚合。结果稳定为完整 UTF-8 前缀éé|中(hexC3A9C3A97CE4B8AD),SHOW WARNINGS稳定返回两条Warning 1260 Row 2 was cut by GROUP_CONCAT();连续 3 轮一致。Happy Path 覆盖
PREPARE/EXECUTE的截断聚合返回正确结果并产生一条 warning 1260。1024后,聚合返回完整éé|中中|abcd。Unhappy Path 覆盖
SHOW WARNINGS为空,确认不会保留先前语句的 stale diagnostics。白盒验证
不适用。本轮以 SQL 可观测 warning 契约验证;修复 PR #28504 中
GROUP_CONCATdiagnostics 定向单测已在当前 main 通过。回归测试
已加入 MOTR:motr#156,文件
suites/14_issue_regression/t/issue_28221_28252_28253_findinset_group_concat.test。该 case 连续 3 轮通过,共 135/135 条 SQL 成功。测试证据
测试结论
测试通过。
fix(sql): report group concat truncation warnings (matrixorigin#28504)
fix(sql): report group concat truncation warnings (matrixorigin#28504)
fix(sql): report group concat truncation warnings (matrixorigin#28504)