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]: prepared GROUP_CONCAT ignores MySQL prepare-time limit floor #28253
A prepared GROUP_CONCAT statement reacts differently from MySQL when group_concat_max_len is reduced after PREPARE.
MySQL preserves the statement's prepare-time lower bound: preparing with a sufficiently large value and then reducing the session value does not shorten later executions. MatrixOne applies the reduced execution-time value and returns a truncated result.
Increasing the value after preparing with a small limit expands the result in both systems, so this is specifically the missing prepare-time lower-bound behavior rather than a generally fixed parameter value.
createdatabasecodex_group_concat_prepare_limit;
use codex_group_concat_prepare_limit;
createtableg(id intprimary key, v varchar(20));
insert into g values (1,'éé'),(2,'中中'),(3,'abcd');
set session group_concat_max_len=1024;
prepare ps from'select group_concat(v order by id separator \'|\') from g';
set session group_concat_max_len=5;
execute ps;
MatrixOne returns the execution-time-limited value:
éé|
MySQL returns the complete value:
éé|中中|abcd
The reverse direction confirms the boundary:
set session group_concat_max_len=5;
prepare ps2 from'select group_concat(v order by id separator \'|\') from g';
execute ps2; -- both: éé|set session group_concat_max_len=1024;
execute ps2; -- both: éé|中中|abcd
Expected behavior
Prepared GROUP_CONCAT statements should follow MySQL's behavior when group_concat_max_len changes after preparation, including retaining the prepare-time lower bound when the session value is reduced.
Activity
fix(sql): report group concat truncation warnings (#28504)
Ariznawlll commentedon Sep 10, 2026
测试版本
main2b250abbc74b4443a2776655b2004bb9dc94ebe3原问题验证
先以
group_concat_max_len=1024PREPARE 聚合,再将会话值降为5后 EXECUTE;结果仍稳定返回完整éé|中中|abcd,保留 prepare-time lower bound。连续执行 3 轮一致。Happy Path 覆盖
5:两次 EXECUTE 都返回完整结果。1024后再次 EXECUTE:结果仍完整,证明预处理状态可复用。5PREPARE 后立即 EXECUTE:返回截断结果éé|;随后提升为1024后正确扩展为完整结果。Unhappy Path 覆盖
5截断已按大上限 PREPARE 的语句。白盒验证
不适用。本轮以 SQL
PREPARE/EXECUTE的公开语义验证;修复 PR #28504 中TestPreparedGroupConcatFloorCapturedWithoutPhysicalCompile定向测试已在当前 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)