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]: GROUP_CONCAT with ORDER BY panics with index out of range #24359
GROUP_CONCAT with multiple arguments and ORDER BY triggers a panic:
ERROR 20101 (HY000): internal error: panic runtime error: index out of range [1] with length 1:
runtime.goPanicIndex
/home/github/go/pkg/mod/golang.org/[email protected]/src/runtime/panic.go:115
github.com/matrixorigin/matrixone/pkg/sql/colexec/aggexec.(*groupConcatExec).Fill
Reproduction
SELECT GROUP_CONCAT(attname, ':', att_length ORDER BY attnum)
FROMmo_catalog.mo_columnsWHERE att_database='mo_catalog'AND att_relname='mo_columns'LIMIT1;
Root Cause
(*groupConcatExec).Fill in pkg/sql/colexec/aggexec accesses an index beyond the slice length when the function has multiple expression arguments combined with an ORDER BY clause.
Expected Behavior
Should return the concatenated string of column values separated by the specified separator, ordered by attnum.
Impact
Any query using GROUP_CONCAT with multiple arguments + ORDER BY will crash the CN with a panic. This is a server-crash-level bug.
Activity
daviszhen commentedon May 13, 2026
我看看
daviszhen commentedon May 18, 2026
main上group_concat的改写也是错误的. issue暂时不能close
fix: support ordered GROUP_CONCAT arguments (#26204)
Ariznawlll commentedon Jul 30, 2026
测试版本
main(截至 2026-07-30 16:30,Asia/Shanghai)41332062a6740978f269088a92ee362a888c7bd7etc/launch-with-proxy/launch.toml(2 CN + 1 TN + Proxy),SQL 入口127.0.0.1:6001原问题验证
执行 issue 原始 catalog 查询
GROUP_CONCAT(attname,':',att_length ORDER BY attnum),返回非空有序结果,未出现 index out of range/panic;完整黑盒 3/3 通过。Happy Path 覆盖
Unhappy Path 覆盖
白盒验证
ordered GROUP_CONCAT、spill/cancellation、payload validation 定向 UT 连续 3 轮通过;aggexec 定向
-race通过。回归测试
修复提交
f41a6d112已扩展test/distributed/cases/function/function_group_concat.sql并加入完整 aggexec/group UT。测试证据
完整 3 轮 SQL 结果、测试脚本、Proxy 黑盒日志、定向 UT 与
-race输出:https://gist.github.com/Ariznawlll/b8f1a22642a58fd5264482687534728b测试结论
测试通过。
Ariznawlll commentedon Jul 30, 2026
motr 黑盒回归已补充
suites/14_issue_regression/t/issue_24359_ordered_group_concat.testmain@41332062a6740978f269088a92ee362a888c7bd7,该批 14 个用例连续 3 轮为 42/42 成功(504/504 语句);完整14_issue_regressionsuite 为 124 成功、0 失败。fix: support ordered GROUP_CONCAT arguments (matrixorigin#26204)
fix: support ordered GROUP_CONCAT arguments (matrixorigin#26204)
fix: support ordered GROUP_CONCAT arguments (matrixorigin#26204)