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
- Version or commit-id (e.g. v0.1.0 or 8b23a93): 6dedae20180c9e7ad4159ef0c7ad0f8e8c358dee
- Hardware parameters: MAC M1 ARM 16GB
- OS type: OSX
- Others:
Actual Behavior
create table t1 (grp int, a bigint unsigned, c char(10) not null);
insert into t1 values (1,1,"a");
insert into t1 values (2,2,"b");
insert into t1 values (2,3,"c");
insert into t1 values (3,4,"E");
insert into t1 values (3,5,"C");
insert into t1 values (3,6,"D");
select sum(all a),count(all a),avg(all a),std(all a),variance(all a),bit_or(all a),bit_and(all a),min(all a),max(all a),min(all c),max(all c) from t1;
[SQL STATEMENT]: select sum(all a),count(all a),avg(all a),std(all a),variance(all a),bit_or(all a),bit_and(all a),min(all a),max(all a),min(all c),max(all c) from t1;
[EXPECT RESULT]:
sum(all a) count(all a) avg(all a) std(all a) variance(all a) bit_or(all a) bit_and(all a) min(all a) max(all a) min(all c) max(all c)
21 6 3.5000 1.707825127659933 2.9166666666666665 7 0 1 6 a E
[ACTUAL RESULT]:
sum(all a) count(all a) avg(all a) std(all a) variance(all a) bit_or(all a) bit_and(all a) min(all a) max(all a) min(all c) max(all c)
21 6 3.5 1.707825127659933 2.916666666666666 7 0 1 6 C c
Client protocol: MOTR and mysql CLI through the MySQL text protocol.
What Was Covered
OK — Original scenario: mixed-case CHAR(10) values return MIN='a' and MAX='E' under the default text collation.
OK — Happy path: VARCHAR(10) returns the same text-collation-aware MIN and MAX values as CHAR(10).
OK — Numeric aggregate control: SUM, COUNT, AVG, STD, VARIANCE, BIT_OR, BIT_AND, numeric MIN, and numeric MAX retain the expected results.
OK — Compatibility control: utf8mb4_bin deliberately follows byte order and returns MIN='C', MAX='c'.
OK — Boundary/null path: mixed NULL and text values ignore NULL; all-NULL input returns NULL for both MIN and MAX.
OK — Recorded/replayed through Proxy, CN1 direct, and CN2 direct endpoints.
Not covered — Non-default non-binary locale-specific collations; this regression focuses on the default text and explicit binary collation distinction reported by the issue.
Findings
The historical collation bug is fixed. Text MIN/MAX no longer use physical byte order for default text columns, while explicit utf8mb4_bin retains binary ordering by design.
Large-data regression is not required: the defect is a scalar comparison/collation contract and does not depend on row count, block/batch boundaries, memory/spill, concurrency, skew, network transfer, or resource scale.
MOTR commit: ba04940 — test: add MOTR regression for #3344.
Independent branch push is pending because the repository connection did not complete; no issue-specific PR was created.
Final Conclusion
Fixed. Default text-collation MIN/MAX now produce semantically ordered results, explicit binary collation keeps byte ordering, and NULL behavior remains correct. Large-data regression is not needed because data volume does not affect this comparison contract.
Activity
fengttt commentedon Jun 24, 2022
There are multiple problems -- precision of avg, std, etc, which should be considered OK.
min/max has a collation problem, which we will punt to 0.6.
dengn commentedon Jun 30, 2022
New collation support can be in 0.6, but we may just specify in documentation what's our collation and string comparison order.
daviszhen commentedon Sep 19, 2022
it only can be fixed after the #3616 (p1) is done.
49 remaining items
slyunnn commentedon Aug 24, 2026
Regression and extended verification for #3344 (2026-08-24)
Verification Environment
origin/main:a4465b3846c770b8f3e2c313a624afd8534427da—fix: restore IVFFlat storage Top-K (#27494).mainwas built locally asmo-servicewith embedded commita4465b3846.866517223d58e805884dad9a095a76d540a1d03f—fix: honor text collation in min and max (#26627).127.0.0.1:16001, CN2127.0.0.1:16002, Proxy127.0.0.1:6009.What Was Covered
CHAR(10)values returnMIN='a'andMAX='E'under the default text collation.VARCHAR(10)returns the same text-collation-awareMINandMAXvalues asCHAR(10).SUM,COUNT,AVG,STD,VARIANCE,BIT_OR,BIT_AND, numericMIN, and numericMAXretain the expected results.utf8mb4_bindeliberately follows byte order and returnsMIN='C',MAX='c'.NULLand text values ignoreNULL; all-NULLinput returnsNULLfor bothMINandMAX.Findings
The historical collation bug is fixed. Text
MIN/MAXno longer use physical byte order for default text columns, while explicitutf8mb4_binretains binary ordering by design.Large-data regression is not required: the defect is a scalar comparison/collation contract and does not depend on row count, block/batch boundaries, memory/spill, concurrency, skew, network transfer, or resource scale.
MOTR / BVT Coverage
suites/14_issue_regression/t/issue_3344_min_max_collation.test.suites/14_issue_regression/r/issue_3344_min_max_collation.result.14/14.14/14.14/14.test/issue-3344-min-max-collation.ba04940—test: add MOTR regression for #3344.Final Conclusion
Fixed. Default text-collation
MIN/MAXnow produce semantically ordered results, explicit binary collation keeps byte ordering, andNULLbehavior remains correct. Large-data regression is not needed because data volume does not affect this comparison contract.fix: honor text collation in min and max (matrixorigin#26627)
fix: honor text collation in min and max (matrixorigin#26627)
fix: honor text collation in min and max (matrixorigin#26627)