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
[Compatibility]: string numeric-result functions materialize incompatible width or signedness #28909
Several numeric-result string functions are materialized with incompatible width or signedness in MatrixOne Views and CTAS tables:
FIND_IN_SET becomes BIGINT UNSIGNED instead of signed INT;
STRCMP becomes TINYINT instead of signed INT;
CHAR_LENGTH becomes BIGINT UNSIGNED instead of signed BIGINT.
Reproduction
dropdatabase if exists find_in_set_type_repro;
createdatabasefind_in_set_type_repro;
use find_in_set_type_repro;
createtablesrc(id intprimary key,needle varchar(20),csv varchar(100));
insert into src values
(1,'b','a,b,,c'),
(2,'','a,b,,c'),
(3,'中','甲,中,乙'),
(4,null,null);
createviewvasselect id,
find_in_set(needle,csv) pos,
strcmp(needle,'a') cmp,
char_length(csv) chars
from src;
createtablectasasselect*from v;
select table_name,column_name,data_type,column_type,is_nullable,
numeric_precision,numeric_scale
frominformation_schema.columnswhere table_schema=database() and table_name in ('v','ctas')
order by table_name,ordinal_position;
MatrixOne result
In both the View and CTAS table:
pos is BIGINT UNSIGNED;
cmp is TINYINT;
chars is BIGINT UNSIGNED.
MySQL 8.0.45 result
In both the View and CTAS table:
pos and cmp are signed INT;
chars is signed BIGINT.
Scalar values agree when inputs use relations that both systems implement identically. Collation-sensitive value differences are tracked separately in #25096; this issue concerns the persisted numeric schema contract.
Protocol control
A direct constant expression is exposed through the wire protocol as LONGLONG by both systems, but MatrixOne sets the UNSIGNED flag and reports display length 64, while MySQL reports a signed numeric result with display length 3. View/CTAS inspection is the stable DDL-level reproduction above.
Incorrect signedness and width propagate into CTAS schemas, generated client models, and connectors that derive types from INFORMATION_SCHEMA.
Scope
Direct SQL, table columns, View, CTAS, PreparedStatement, empty element, missing value, UTF-8 input, and NULL are covered. Controls for LENGTH, OCTET_LENGTH, BIT_LENGTH, ASCII, ORD, LOCATE, INSTR, and POSITION materialize with compatible base types. Three independent executions produced identical results on each database.
Environment
MatrixOne: official main commit 0c3a04f390adaf6281fd592a49778ea5b1155e67
changed the title [-][Compatibility]: FIND_IN_SET materializes as BIGINT UNSIGNED instead of INT[/-][+][Compatibility]: string numeric-result functions materialize incompatible width or signedness[/+]on Sep 15, 2026
补充一个同类的数值结果元数据差异:CRC32(expr) 的值域虽然是 32 位无符号整数,但 MySQL 8.0.45 对非常量表达式声明 BIGINT UNSIGNED,MatrixOne 声明 INT UNSIGNED。
CREATETABLEsrc(v VARCHAR(10));
INSERT INTO src VALUES ('x');
CREATEVIEWvcrcASSELECT CRC32(v) AS c FROM src;
CREATETABLEccrcASSELECT CRC32(v) AS c FROM src;
SELECT table_name,column_name,data_type,column_type,numeric_precision
FROMinformation_schema.columnsWHERE table_schema=DATABASE() AND table_name IN ('vcrc','ccrc')
ORDER BY table_name;
MatrixOne 的 View 与 CTAS 均为 INT UNSIGNED、precision 10;MySQL 均为 BIGINT UNSIGNED、precision 20。校验值本身与 MySQL 一致,差异只在可观察的列元数据,属于本 issue 已描述的数值结果类型/宽度兼容性问题。
该差异在两端各重复 3 次。验证版本:official main commit 0c3a04f390adaf6281fd592a49778ea5b1155e67;MySQL 8.0.45。
Environment: latest origin/main at 3727c5c5436ca136d7b0312f75bc223a11692a85 (fix(frontend): require alter role privilege for SHOW RULES (#29217)), rebuilt locally with make TYPECHECK=0 dev-build and deployed as 1 Log service / 1 TN / 2 CN / Proxy. Proxy :6001, CN1 :16001, and CN2 :16002 were independently exercised through go-sql-driver/mysql over the MySQL wire protocol. MySQL 8.0.45 was the compatibility control.
PR #28915 / 8a4c84f4516d5098de9eef50b8afecc7524f37a2 fixes the persisted-schema part of this issue. The original View and CTAS reproduction now matches MySQL on all three MatrixOne endpoints:
FIND_IN_SET and STRCMP: signed INT / precision 10.
CHAR_LENGTH: signed BIGINT / precision 19.
The same verification also passed for the issue comments' CRC32: BIGINT UNSIGNED / precision 20, and UNCOMPRESSED_LENGTH: signed BIGINT / precision 19.
Empty element, missing value, UTF-8, empty-string, NULL, and valid-value controls matched MySQL. Existing BVT test/distributed/cases/function/func_bounded_result_metadata.test covers the persisted metadata contract.
Remaining compatibility gap:
Reproduction: execute SELECT FIND_IN_SET('b', 'a,b'), STRCMP('a', 'b') as either text SQL or a real MySQL binary prepared statement.
MatrixOne: both result columns are exposed as signed INT / Go int32.
MySQL 8.0.45: both result columns are exposed as signed BIGINT / Go int64.
The mismatch reproduces through Proxy, CN1, and CN2. Values are correct; the remaining difference is observable result-set metadata and can affect protocol-derived client models.
Please preserve the corrected signed INT persisted schema for Views/CTAS while making direct and binary prepared result-set metadata for these functions MySQL-compatible (LONGLONG / signed BIGINT, with no UNSIGNED flag). This remains within #28909; no duplicate issue was created.
No large-data regression is needed because this is a per-expression metadata contract, independent of data volume, block/batch boundaries, memory/spill, skew, or concurrency. No MOTR case was added: a protocol assertion for the remaining gap would fail on current main and should accompany the product fix.
Regression and extended verification for #28909 (2026-09-23)
Verification Environment
Source: latest origin/main at 66da3877e9e77f01083c4aac0cb9f94ab6e11fe6 — feat(sql): support EXCEPT ALL multiset subtraction (#29228).
Runtime: a no-cache local image build from that checkout, sha256:e3927aba7b94bc18185cc167a38a070b4c6070869d7bd08fccb591add9cb28c5; Proxy, CN1, and CN2 were confirmed to run that image.
Topology: local 1 Log service / 1 TN / 2 CN / Proxy, using a new isolated data root so no existing local cluster data was reset or changed.
Endpoints: Proxy :6001, CN1 :16001, and CN2 :16002 were each reachable and each executed the original DDL, direct SQL, and binary prepared-statement regression paths.
Client protocol: go-sql-driver/mysql over the MySQL wire protocol. Both text COM_QUERY and real COM_STMT_PREPARE / COM_STMT_EXECUTE were used. MySQL 8.0.45 was the compatibility control.
Related fixes: 8a4c84f4516d5098de9eef50b8afecc7524f37a2 / PR #28915 (fix compatibility for concat, prepared elt, and string numeric results) fixes persisted result schemas; 27ffab65a0f1c98752bb2fa5e852810cc6e12900 / PR #29233 (fix(frontend): preserve direct integer function wire metadata) fixes the direct and binary prepared result-set metadata.
What Was Covered
OK Original View and CTAS reproduction through Proxy, CN1, and CN2: FIND_IN_SET and STRCMP materialized as signed INT with precision 10; CHAR_LENGTH materialized as signed BIGINT with precision 19, matching MySQL 8.0.45.
OK Persisted-schema extensions: CRC32 materialized as BIGINT UNSIGNED with precision 20, and UNCOMPRESSED_LENGTH(COMPRESS(...)) as signed BIGINT with precision 19, in both View and CTAS.
OK Happy path values: rows with ordinary ASCII and UTF-8 values returned matching FIND_IN_SET positions and CHAR_LENGTH values on all endpoints.
OK Boundary and unhappy controls: empty list member returned 3, missing member returned 0, UTF-8 member returned 2, STRCMP('a','a') returned 0, STRCMP('', 'a') returned -1, empty CHAR_LENGTH returned 0, and NULL returned NULL, matching MySQL.
OK Compatibility controls: View metadata for LENGTH, OCTET_LENGTH, BIT_LENGTH, ASCII, ORD, LOCATE, INSTR, and POSITION matched MySQL.
OK Direct text protocol: SELECT FIND_IN_SET('b','a,b'), STRCMP('a','b') exposed signed BIGINT / int64 on Proxy, CN1, and CN2, matching MySQL.
OK Binary prepared protocol: COM_STMT_PREPARE / COM_STMT_EXECUTE for FIND_IN_SET(?,'a,b') and STRCMP(?,'b') exposed signed BIGINT / int64 and returned 2 and -1 on all endpoints, matching MySQL.
Not covered: the special direct-result presentation is intentionally not applied to DISTINCT, grouping, set operations, enclosing expressions, star expansion, or forwarded derived/View columns. These query shapes are outside the original #28909 reproduction scope and were explicitly excluded by PR #29233.
Findings
The two-step repair is effective. PR #28915 corrected the logical result domain and persisted View/CTAS schemas; PR #29233 preserves MySQL-compatible signed LONGLONG presentation for direct projected FIND_IN_SET and STRCMP results without changing their internal signed INT execution vectors or persisted schemas.
The focused embedded-cluster regression TestIssue28909DirectFunctionWireMetadata and frontend tests TestDirectIntegerBinaryRows, TestDirectIntegerResultClassification, and TestDirectIntegerPrepareWireMetadata passed.
No large-data regression is needed. This is a per-expression schema and result-set metadata contract, independent of row count, block/batch boundaries, memory/spill, skew, network transfer, or concurrency. The small multi-row case is sufficient to verify value, NULL, and metadata propagation.
MOTR / BVT Coverage
Existing BVT test/distributed/cases/function/func_bounded_result_metadata.test covers the persisted metadata contract.
Existing focused issue regression pkg/tests/issues/issue_28909_test.go covers direct and binary prepared wire metadata, parameter reuse, View/CTAS preservation, and schema rebuild behavior.
No MOTR change, issue branch, or daily-regression commit was needed because current upstream coverage already contains the required regression tests.
Endpoint cases were run serially because each creates and drops the same temporary schema. No MOTR parallel scheduler was used, and this is not an engine-parallelism stress test.
Final Conclusion
Fixed. The original #28909 View/CTAS width and signedness regression and its direct/binary prepared result-set metadata follow-up both match MySQL 8.0.45 on Proxy, CN1, and CN2. Large-data regression is not required for the stated per-expression metadata reason.
Activity
[-][Compatibility]: FIND_IN_SET materializes as BIGINT UNSIGNED instead of INT[/-][+][Compatibility]: string numeric-result functions materialize incompatible width or signedness[/+]Ariznawlll commentedon Sep 15, 2026
补充一个同类的数值结果元数据差异:
CRC32(expr)的值域虽然是 32 位无符号整数,但 MySQL 8.0.45 对非常量表达式声明BIGINT UNSIGNED,MatrixOne 声明INT UNSIGNED。MatrixOne 的 View 与 CTAS 均为
INT UNSIGNED、precision 10;MySQL 均为BIGINT UNSIGNED、precision 20。校验值本身与 MySQL 一致,差异只在可观察的列元数据,属于本 issue 已描述的数值结果类型/宽度兼容性问题。该差异在两端各重复 3 次。验证版本:official
maincommit0c3a04f390adaf6281fd592a49778ea5b1155e67;MySQL 8.0.45。Ariznawlll commentedon Sep 15, 2026
补充
UNCOMPRESSED_LENGTH(expr)的可观察返回类型差异:对 View 与 CTAS 中的列表达式,MatrixOne 声明INT(precision 10),MySQL 8.0.45 声明BIGINT(precision 19)。有效输入的数值结果一致,差异只在结果列元数据,因此归入本 issue 的数值结果宽度兼容范围。验证语句覆盖
UNCOMPRESSED_LENGTH(COMPRESS(varchar_column))的 View、CTAS、NULL、空串、Unicode、VARBINARY 和 prepared 执行,并在两端各重复 3 次。验证版本:official
maincommit0c3a04f390adaf6281fd592a49778ea5b1155e67;MySQL 8.0.45。fix compatibility for concat, prepared elt, and string numeric results (
fix compatibility for concat, prepared elt, and string numeric results (
fix compatibility for concat, prepared elt, and string numeric results (
slyunnn commentedon Sep 22, 2026
Regression result: Partially fixed.
Environment: latest
origin/mainat3727c5c5436ca136d7b0312f75bc223a11692a85(fix(frontend): require alter role privilege for SHOW RULES (#29217)), rebuilt locally withmake TYPECHECK=0 dev-buildand deployed as1 Log service / 1 TN / 2 CN / Proxy. Proxy:6001, CN1:16001, and CN2:16002were independently exercised throughgo-sql-driver/mysqlover the MySQL wire protocol. MySQL8.0.45was the compatibility control.PR
#28915/8a4c84f4516d5098de9eef50b8afecc7524f37a2fixes the persisted-schema part of this issue. The original View and CTAS reproduction now matches MySQL on all three MatrixOne endpoints:FIND_IN_SETandSTRCMP: signedINT/ precision10.CHAR_LENGTH: signedBIGINT/ precision19.CRC32:BIGINT UNSIGNED/ precision20, andUNCOMPRESSED_LENGTH: signedBIGINT/ precision19.NULL, and valid-value controls matched MySQL. Existing BVTtest/distributed/cases/function/func_bounded_result_metadata.testcovers the persisted metadata contract.Remaining compatibility gap:
SELECT FIND_IN_SET('b', 'a,b'), STRCMP('a', 'b')as either text SQL or a real MySQL binary prepared statement.INT/ Goint32.8.0.45: both result columns are exposed as signedBIGINT/ Goint64.Please preserve the corrected signed
INTpersisted schema for Views/CTAS while making direct and binary prepared result-set metadata for these functions MySQL-compatible (LONGLONG/ signedBIGINT, with noUNSIGNEDflag). This remains within#28909; no duplicate issue was created.No large-data regression is needed because this is a per-expression metadata contract, independent of data volume, block/batch boundaries, memory/spill, skew, or concurrency. No MOTR case was added: a protocol assertion for the remaining gap would fail on current
mainand should accompany the product fix.fix(frontend): preserve direct integer function wire metadata (#29233)
slyunnn commentedon Sep 23, 2026
Regression and extended verification for #28909 (2026-09-23)
Verification Environment
origin/mainat66da3877e9e77f01083c4aac0cb9f94ab6e11fe6—feat(sql): support EXCEPT ALL multiset subtraction (#29228).sha256:e3927aba7b94bc18185cc167a38a070b4c6070869d7bd08fccb591add9cb28c5; Proxy, CN1, and CN2 were confirmed to run that image.1 Log service / 1 TN / 2 CN / Proxy, using a new isolated data root so no existing local cluster data was reset or changed.:6001, CN1:16001, and CN2:16002were each reachable and each executed the original DDL, direct SQL, and binary prepared-statement regression paths.go-sql-driver/mysqlover the MySQL wire protocol. Both textCOM_QUERYand realCOM_STMT_PREPARE/COM_STMT_EXECUTEwere used. MySQL8.0.45was the compatibility control.8a4c84f4516d5098de9eef50b8afecc7524f37a2/ PR#28915(fix compatibility for concat, prepared elt, and string numeric results) fixes persisted result schemas;27ffab65a0f1c98752bb2fa5e852810cc6e12900/ PR#29233(fix(frontend): preserve direct integer function wire metadata) fixes the direct and binary prepared result-set metadata.What Was Covered
FIND_IN_SETandSTRCMPmaterialized as signedINTwith precision10;CHAR_LENGTHmaterialized as signedBIGINTwith precision19, matching MySQL8.0.45.CRC32materialized asBIGINT UNSIGNEDwith precision20, andUNCOMPRESSED_LENGTH(COMPRESS(...))as signedBIGINTwith precision19, in both View and CTAS.FIND_IN_SETpositions andCHAR_LENGTHvalues on all endpoints.3, missing member returned0, UTF-8 member returned2,STRCMP('a','a')returned0,STRCMP('', 'a')returned-1, emptyCHAR_LENGTHreturned0, andNULLreturnedNULL, matching MySQL.LENGTH,OCTET_LENGTH,BIT_LENGTH,ASCII,ORD,LOCATE,INSTR, andPOSITIONmatched MySQL.SELECT FIND_IN_SET('b','a,b'), STRCMP('a','b')exposed signedBIGINT/int64on Proxy, CN1, and CN2, matching MySQL.COM_STMT_PREPARE/COM_STMT_EXECUTEforFIND_IN_SET(?,'a,b')andSTRCMP(?,'b')exposed signedBIGINT/int64and returned2and-1on all endpoints, matching MySQL.DISTINCT, grouping, set operations, enclosing expressions, star expansion, or forwarded derived/View columns. These query shapes are outside the original#28909reproduction scope and were explicitly excluded by PR#29233.Findings
The two-step repair is effective. PR
#28915corrected the logical result domain and persisted View/CTAS schemas; PR#29233preserves MySQL-compatible signedLONGLONGpresentation for direct projectedFIND_IN_SETandSTRCMPresults without changing their internal signedINTexecution vectors or persisted schemas.The focused embedded-cluster regression
TestIssue28909DirectFunctionWireMetadataand frontend testsTestDirectIntegerBinaryRows,TestDirectIntegerResultClassification, andTestDirectIntegerPrepareWireMetadatapassed.No large-data regression is needed. This is a per-expression schema and result-set metadata contract, independent of row count, block/batch boundaries, memory/spill, skew, network transfer, or concurrency. The small multi-row case is sufficient to verify value,
NULL, and metadata propagation.MOTR / BVT Coverage
test/distributed/cases/function/func_bounded_result_metadata.testcovers the persisted metadata contract.pkg/tests/issues/issue_28909_test.gocovers direct and binary prepared wire metadata, parameter reuse, View/CTAS preservation, and schema rebuild behavior.Final Conclusion
Fixed. The original
#28909View/CTAS width and signedness regression and its direct/binary prepared result-set metadata follow-up both match MySQL8.0.45on Proxy, CN1, and CN2. Large-data regression is not required for the stated per-expression metadata reason.Ariznawlll commentedon Sep 23, 2026
最新 main 验证通过,关闭。
验证版本:
16d8e5106caaedfe0a7296e4f628683e1b6a92b4,包含 PR #28915 与 #29233。TestIssue28909DirectFunctionWireMetadata连续 3 次通过,覆盖:FIND_IN_SET/STRCMP对外元数据均为 signedBIGINT,值为2/-1;INT域,不被 direct-wire 展示规则污染。核心验收是 MySQL wire result metadata,纯 SQL MOTR 无法读取列 type/flag,故定向产品集成测试是准确回归位置。