Repository navigation
Description
Description
Under STRICT_TRANS_TABLES, MatrixOne persists a value truncated by GROUP_CONCAT through INSERT ... SELECT and CREATE TABLE ... AS SELECT. MySQL promotes warning 1260 to an error in these data-writing contexts and leaves the target empty or uncreated.
Plain SELECT, non-strict DML, and INSERT IGNORE behavior already match; the gap is the missing strict-mode promotion during materialization.
Environment
- Branch:
main - Commit:
e7d46d6dfb27696211ca828c55e245d3bd1b634d - Deployment: local standalone (
1 CN / 1 TN / 1 LogService) - Oracle: MySQL 8.3.0, isolated local instance
Steps to reproduce
drop database if exists gc_strict_materialization;
create database gc_strict_materialization;
use gc_strict_materialization;
create table src (id int primary key, v varchar(20));
insert into src values (1, 'aa'), (2, 'bbb'), (3, 'cccc');
create table dst_strict (gc varchar(100));
set session group_concat_max_len = 4;
set session sql_mode = 'STRICT_TRANS_TABLES';
select group_concat(v order by id separator '|') from src;
show warnings;
insert into dst_strict
select group_concat(v order by id separator '|') from src;
select count(*), max(hex(gc)) from dst_strict;
create table ctas_strict as
select group_concat(v order by id separator '|') as gc from src;Controls:
insert ignore into dst_ignore
select group_concat(v order by id separator '|') from src;
set session sql_mode = '';
insert into dst_nonstrict
select group_concat(v order by id separator '|') from src;Actual behavior
MatrixOne stores the truncated value in both strict paths:
plain_select: aa|b, warning 1260 Row 2 was cut by GROUP_CONCAT()
dst_strict: count=1, hex=61617C62
ctas_strict: count=1, hex=61617C62
Expected behavior
With STRICT_TRANS_TABLES, both writing statements should return error 1260. dst_strict should remain empty, and ctas_strict should not be created. MySQL 8.3.0 behaves this way.
INSERT IGNORE and non-strict mode should continue to persist aa|b with warning 1260, which both systems already do.
Stability and controls
- Reproducer: 3/3 for strict
INSERT ... SELECTand CTAS. - Plain SELECT control: both systems return
aa|bwith warning 1260. INSERT IGNOREcontrol: both systems persist oneaa|brow with warning 1260.- Non-strict control: both systems persist one
aa|brow with warning 1260. - MySQL 8.3.0 strict oracle: 3/3 error 1260; destination remains empty and CTAS table is absent.
- MatrixOne post-write check: source rows remain intact; only the unexpected target row/table is created.
Evidence
All three MatrixOne runs are byte-identical, and all three MySQL runs are byte-identical.
MatrixOne STRICT: dst_strict rows=1; ctas_strict rows=1
MySQL STRICT: ERROR 1260; dst_strict rows=0; ctas_strict does not exist
Both INSERT IGNORE/non-strict: one row, hex 61617C62, warning 1260
Code analysis
The aggregate records ER_CUT_VALUE_GROUP_CONCAT through AppendWarningBatch / AppendWarningDiagnostic. The warning transport correctly reaches the session, as shown by SHOW WARNINGS, but the DML/CTAS materialization path does not promote it according to strict SQL mode before commit.
The exact promotion point requires executor/frontend ownership analysis; this report does not assume that the aggregate itself should return an error in ordinary SELECT.
Regression coverage
After the compatibility fix, add SQL coverage for plain SELECT, strict INSERT-SELECT, strict CTAS, INSERT IGNORE, and non-strict mode. Assert target-table atomicity, warning/error 1260, and prepared execution.
Related
- [Compatibility]: GROUP_CONCAT truncation does not emit MySQL warning 1260 #28252/fix(sql): report group concat truncation warnings #28504 added warning 1260 for SELECT but do not cover strict materialization.
- [Bug]: CTAS bypasses ERROR_FOR_DIVISION_BY_ZERO and persists NULL rows #28605 covers
ERROR_FOR_DIVISION_BY_ZEROin CTAS, not GROUP_CONCAT warning promotion or INSERT-SELECT. - [Bug]: tracker for remaining CTAS schema inconsistencies with MySQL #24436 tracks CTAS schema inference; this issue concerns strict value-write semantics.
Activity
[-][Compatibility]: STRICT mode persists truncated GROUP_CONCAT through INSERT-SELECT and CTAS[/-][+][Compatibility]: STRICT mode persists truncated GROUP_CONCAT through write statements[/+]Ariznawlll commentedon Sep 11, 2026
在最新
main(e7d46d6dfb27696211ca828c55e245d3bd1b634d)继续扩大写入路径后,确认同一 strict-mode warning 提升缺口还覆盖UPDATE、REPLACE ... SELECT和INSERT ... SELECT ... ON DUPLICATE KEY UPDATE,并非只发生在原 issue 的 INSERT-SELECT/CTAS。源聚合在
group_concat_max_len=4下产生aa|b和 warning 1260,目标表原值为sentinel:MatrixOne 三条语句都成功,并把目标值改为
aa|b(hex61617C62)。MySQL 8.3.0 三条语句都返回ERROR 1260 Row 2 was cut by GROUP_CONCAT(),目标值保持sentinel(hex73656E74696E656C)。显式事务中的 UPDATE 后执行 ROLLBACK,两端都恢复/保留
sentinel,说明普通事务回滚本身正常;错误在于 MatrixOne 没有在 strict 写入语句提交前把 aggregate warning 提升为 statement error。以上矩阵连续 3 轮一致:
cc33eb3fb986d459e734161d9a72ad6af5b4f082bdb45990f9a4142a7d881b91e6cf18ddc437d8a7b37f752e1085b36019b0069a653b6a116866b8f74239948a因此修复和回归范围需要覆盖所有把 SELECT aggregate 结果写入表的 statement 类别,而不能只在 INSERT 或 CTAS 的某个入口处理。
XuPeng-SH commentedon Sep 11, 2026
Triage decision: promote to severity/s0 and assign to aunjgr.
Evidence: 3/3 runs show STRICT_TRANS_TABLES incorrectly persists GROUP_CONCAT-truncated values through INSERT-SELECT, CTAS, UPDATE, REPLACE, and INSERT ... ON DUPLICATE KEY UPDATE, while MySQL raises error 1260 and preserves the target state. This is a confirmed data-correctness/statement-atomicity compatibility violation. The fix must be at the warning-to-error materialization boundary and cover all write paths without changing non-strict or INSERT IGNORE behavior.
fix: promote group_concat truncation on strict writes (#28705)
Ariznawlll commentedon Sep 14, 2026
测试版本
maina72a224ce85fd13aa919fb56dab58b8c60b366dc(2026-09-14 获取的最新origin/main)原问题验证
连续 3 轮执行同一组 GROUP_CONCAT 截断场景,输出一致。普通
SELECT GROUP_CONCAT(...)返回截断值aa|b,并产生 MySQL warning 1260(Row 2 was cut by GROUP_CONCAT())。在STRICT_TRANS_TABLES下,写语句不会再将该 warning 静默带入写入结果。Happy Path 覆盖
aa|b,且可通过SHOW WARNINGS获取 1260 告警。INSERT IGNORE与非严格模式 INSERT 保持 MySQL 兼容行为:写入截断值aa|b(hex61617C62),并保留 1260 warning。Unhappy Path 覆盖
在
STRICT_TRANS_TABLES下逐项验证截断写路径均以 1260 失败,且目标对象保持原子性:sentinel未被修改(hex73656E74696E656C)。白盒验证
在同一 commit 执行:
测试整体 PASS,覆盖截断标记跨 worker 传递、严格写路径提升为 MySQL 1260、预编译/重试编译及不完整 worker 报告拒绝写入的分支。
回归测试
已新增 MOTR 回归用例:matrixorigin/motr#173。
suites/14_issue_regression/t/issue_28664_group_concat_strict_write.testsuites/14_issue_regression/r/issue_28664_group_concat_strict_write.result执行
./motr --repeat 3 14_issue_regression.issue_28664_group_concat_strict_write -v,3/3 轮通过,合计 123/123 条语句通过(每轮 41 条)。现有test/distributed/cases/function/group_concat_strict_write.sql也覆盖了该严格写入矩阵。测试证据
/tmp/mo-issue-validation-20260914/latest14-run/issue-28664-latest.sqlb5007f7ceb9356702660416d0db34d452b70674f测试结论
测试通过。
fix: promote group_concat truncation on strict writes (matrixorigin#2…
fix: promote group_concat truncation on strict writes (matrixorigin#2…
fix: promote group_concat truncation on strict writes (matrixorigin#2…