Skip to content

[Compatibility]: GROUP_CONCAT truncation does not emit MySQL warning 1260 #28252

Closed

Description

@Ariznawlll

Problem

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.

Version

  • MatrixOne main: e7bb0572235ec4bac81eb098eb0ad8900f0065ab
  • MySQL: 8.3.0

Reproduction

create database codex_group_concat_warning;
use codex_group_concat_warning;
create table g(id int primary 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

  1. added this to the MO-202609 milestone on Sep 5, 2026
  2. added
    kind/bug
    on Sep 5, 2026
  3. added theissue type on Sep 5, 2026
  4. self-assigned this
    on Sep 5, 2026
  5. added a commit that references this issue on Sep 10, 2026
    2b250ab
  6. Ariznawlll commented on Sep 10, 2026

    @Ariznawlll
    CollaboratorAuthor

    测试版本

    • 分支:main
    • commit:2b250abbc74b4443a2776655b2004bb9dc94ebe3
    • 部署方式:本地隔离 standalone,1 CN / 1 TN / 1 LogService
    • 测试日期:2026-09-10

    原问题验证

    将 group_concat_max_len 设为 8,对 éé、中中、abcd 执行两个独立的截断 GROUP_CONCAT 聚合。结果稳定为完整 UTF-8 前缀 éé|中(hex C3A9C3A97CE4B8AD),SHOW WARNINGS 稳定返回两条 Warning 1260 Row 2 was cut by GROUP_CONCAT();连续 3 轮一致。

    Happy Path 覆盖

    1. 两个独立聚合实例各产生一条 warning 1260,共两条。
    2. SQL PREPARE/EXECUTE 的截断聚合返回正确结果并产生一条 warning 1260。
    3. 将会话上限恢复为 1024 后,聚合返回完整 éé|中中|abcd。

    Unhappy Path 覆盖

    1. 截断边界不会截断 UTF-8 字符;结果保持合法文本。
    2. 无截断控制后 SHOW WARNINGS 为空,确认不会保留先前语句的 stale diagnostics。
    3. 执行结束后清理测试对象,未观察到异常、panic 或会话状态泄漏。

    白盒验证

    不适用。本轮以 SQL 可观测 warning 契约验证;修复 PR #28504 中 GROUP_CONCAT diagnostics 定向单测已在当前 main 通过。

    回归测试

    已加入 MOTR:motr#156,文件 suites/14_issue_regression/t/issue_28221_28252_28253_findinset_group_concat.test。该 case 连续 3 轮通过,共 135/135 条 SQL 成功。

    测试证据

    • 修复 PR:matrixone#28504,已包含于测试 commit。
    • MOTR 回归 PR:motr#156。
    • 3 轮黑盒输出 SHA-256 完全一致。

    测试结论

    测试通过。

  7. added 3 commits that reference this issue on Sep 17, 2026
    42809b0
    9615a40
    9f290b5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bug

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions