Repository navigation
Description
Description
MatrixOne supports SHOW WARNINGS and SHOW ERRORS, but rejects MySQL's corresponding diagnostic-count statements and system variables:
SHOW COUNT(*) WARNINGS;
SHOW COUNT(*) ERRORS;
SELECT @@warning_count;
SELECT @@error_count;This prevents MySQL-compatible clients from reading the number of diagnostics without fetching the complete diagnostic list.
Environment
- Branch:
main - Commit:
065a67528608c475d0219e0be6b7d454a58f7b1a - Deployment: local 2 CN / 1 TN / 1 LogService
- Oracle: MySQL 8.3.0 isolated local instance
Steps to reproduce
create database diag_count_compat;
use diag_count_compat;
create table t(id int primary key,v varchar(10));
insert into t values (1,'aaaa'),(2,'bbbb');
set session group_concat_max_len=5;
select group_concat(v order by id separator '|') from t;
show count(*) warnings;
select group_concat(v order by id separator '|') from t;
select @@warning_count;
select missing_column from t;
show count(*) errors;
select missing_column from t;
select @@error_count;Actual behavior
The two SHOW COUNT(*) statements are rejected by the parser with error 1064 at COUNT(*). The two system variables are rejected with error 20101, the system variable does not exist.
SHOW WARNINGS remains a passing control and exposes the expected 1260 record, so the session has a diagnostic that can be counted.
Expected behavior
As in MySQL 8.3.0:
SHOW COUNT(*) WARNINGSexposes@@session.warning_count;SHOW COUNT(*) ERRORSexposes@@session.error_count;@@warning_countand@@error_countexpose the same counts through expressions.
The reproducer returns 1 for each count in MySQL.
Stability and controls
- MatrixOne reproducer: 3/3 for all four missing interfaces.
- MySQL 8.3.0 oracle: 3/3; warning and error counts are both 1 immediately after the generating statement.
- MatrixOne control:
SHOW WARNINGSreturnsWarning 1260 Row 2 was cut by GROUP_CONCAT(). - No data mutation is involved.
Code analysis
The MySQL parser grammar currently accepts only SHOW WARNINGS limit_opt and the tree.ShowWarnings/tree.ShowErrors nodes have no count form. pkg/frontend/variables.go registers max_error_count, but does not register read-only warning_count or error_count session status variables.
Regression coverage
After implementation, cover all four forms after zero, one, and multiple warnings/errors, including statement reset semantics and LIMIT on the ordinary SHOW WARNINGS/SHOW ERRORS forms.
Activity
Ariznawlll commentedon Sep 11, 2026
在更新后的 official
mainee0c2bf563bf27ff2c80891bb57a1de5886bf90b(本地 2 CN / 1 TN / 1 LogService)复核 3 轮,四个缺失接口每轮表现一致:SHOW COUNT(*) WARNINGS:parser error 1064;SHOW COUNT(*) ERRORS:parser error 1064;@@warning_count:system variable does not exist;@@error_count:system variable does not exist。普通
SHOW WARNINGS仍能返回刚生成的 1260 诊断,说明诊断本身存在,仅计数语法和计数变量缺失。fix: support diagnostic count compatibility (#28738)
Ariznawlll commentedon Sep 14, 2026
测试版本
原问题验证
Happy Path 覆盖
Unhappy Path 覆盖
白盒验证
回归测试
./motr --repeat 3 14_issue_regression.issue_28187_28772_latest_main连续 3/3 通过(213/213 statements matched)。测试证据
测试结论
测试通过。
fix: support diagnostic count compatibility (matrixorigin#28738)
fix: support diagnostic count compatibility (matrixorigin#28738)
fix: support diagnostic count compatibility (matrixorigin#28738)