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
[Bug]: CAST to fixed-length CHAR errors instead of truncating like MySQL #25249
MySQL truncates the character result to the requested length and returns:
123 3
Actual Behavior
MatrixOne returns an error:
ERROR 20101 (HY000): internal error: Can't cast '12345' from BIGINT type to CHAR type. 12345 is larger than Dest length 3
Notes
Found while completing the MySQL-compatible CAST / CONVERT target-type matrix. Passing fixed-length BINARY(4) cast rows were added to BVT; this failing CHAR(3) row was excluded.
Verified on latest origin/main at 7e70bee (fix cast#25340).
Result: fixed.
Validation SQL:
select cast(12345aschar(3)) as numeric_char,
length(cast(12345aschar(3))) as numeric_len;
select cast('abcdef'aschar(3)) as string_char,
length(cast('abcdef'aschar(3))) as string_len;
Activity
daviszhen commentedon Jul 3, 2026
fixed
Ariznawlll commentedon Jul 3, 2026
Verified on latest origin/main at 7e70bee (
fix cast#25340).Result: fixed.
Validation SQL:
Observed result:
Regression has been added to motr in matrixorigin/motr#39, commit b8f14f4 (
issue_25249_cast_char_truncation).Motr validation passed together with the related issue regressions:
Ariznawlll commentedon Jul 3, 2026
Regression case added in matrixorigin/motr#39.
Case:
14_issue_regression.issue_25249_cast_char_truncationTarget branch marker:
@target-branch: mainadd mysql compatibility type conversion and comparison bvt cases (#25219
add mysql compatibility type conversion and comparison bvt cases (mat…
add mysql compatibility type conversion and comparison bvt cases (mat…
add mysql compatibility type conversion and comparison bvt cases (mat…