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]: ASCII exposes TINYINT UNSIGNED result metadata instead of MySQL INT #28455
The closed implementation request #2106 does not cover result metadata. No issue was found for ASCII() CTAS or view result types.
Branch Name
main
Commit ID
a9d3b8b857c44f1249e682c91d4d62a914eb7d20
Other Environment Information
Local standalone MatrixOne built from the commit above
Reference: MySQL 8.3.0
Actual Behavior
ASCII() returns the same scalar values in MatrixOne and MySQL, but MatrixOne exposes a different result type:
CREATETABLEsrc(id INTPRIMARY KEY, s VARCHAR(20));
INSERT INTO src VALUES (1,'A'),(2,'中'),(3,''),(4,NULL);
CREATETABLEdstASSELECT ASCII(s) AS a FROM src;
SELECT DATA_TYPE, COLUMN_TYPE, NUMERIC_PRECISION, NUMERIC_SCALE
FROMinformation_schema.COLUMNSWHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME='dst'AND COLUMN_NAME='a';
Engine
CTAS/view column type
MatrixOne
TINYINT UNSIGNED, precision 3
MySQL 8.3
INT, precision 10
The same metadata difference is visible through a view. It also changes type propagation: a CTAS over ASCII(s) UNION ALL SELECT 300 becomes DOUBLE in MatrixOne but BIGINT in MySQL.
The source values and metadata checks were repeated three times. ASCII('A'), ASCII('中'), ASCII(''), and ASCII(NULL) return the same values in both engines, so this is specifically a result-domain problem.
The built-in registration currently hard-codes the return type to T_uint8, which explains the TINYINT UNSIGNED metadata.
Expected Behavior
ASCII() should expose MySQL-compatible integer result metadata so CTAS, views, set operations, and clients do not observe a narrower unsigned type.
Steps to Reproduce
CREATEDATABASEcodex_ascii_metadata;
USE codex_ascii_metadata;
CREATETABLEsrc(id INTPRIMARY KEY, s VARCHAR(20));
INSERT INTO src VALUES (1,'A'),(2,'中'),(3,''),(4,NULL);
CREATETABLEdstASSELECT ASCII(s) AS a FROM src;
SHOW CREATE TABLE dst;
CREATEVIEWvASSELECT ASCII(s) AS a FROM src;
SELECT DATA_TYPE, COLUMN_TYPE, NUMERIC_PRECISION, NUMERIC_SCALE
FROMinformation_schema.COLUMNSWHERE TABLE_SCHEMA='codex_ascii_metadata'AND TABLE_NAME IN ('dst','v');
Controls
Scalar and column values agree with MySQL for ASCII, multibyte text, empty strings, integers, and NULL.
ORD() metadata is BIGINT in both engines and does not show the same issue.
Activity
fix(function): expose ASCII as signed INT (#28746)
Ariznawlll commentedon Sep 14, 2026
测试版本
原问题验证
Happy Path 覆盖
Unhappy Path 覆盖
白盒验证
回归测试
测试证据
测试结论
测试通过。
Ariznawlll commentedon Sep 14, 2026
测试版本
原问题验证
Happy Path 覆盖
Unhappy Path 覆盖
白盒验证
回归测试
测试证据
测试结论
测试通过。
fix(function): expose ASCII as signed INT (matrixorigin#28746)
fix(function): expose ASCII as signed INT (matrixorigin#28746)
fix(function): expose ASCII as signed INT (matrixorigin#28746)