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]: CONV and BIN reject strings with trailing text instead of using numeric prefixes #28392
Latest main at f72ca9efbeb3a7c673701e4a135cc6670c33cfde. MySQL control: 8.3.0.
What is different
CONV() and BIN() reject character inputs containing trailing nonnumeric text. MySQL consumes the valid leading digit sequence, and returns zero when no valid leading digit exists. This is especially inconsistent because MySQL defines BIN(N) as equivalent to CONV(N, 10, 2).
The constant matrix reproduces identically in three runs per engine. A six-row VARCHAR column containing the same valid-prefix, invalid-prefix, signed, and empty inputs shows the same difference.
Controls
Complete valid inputs across bases 2, 10, 16, and 36 match MySQL.
Signed output bases, BIGINT saturation boundaries, invalid base values, NULL, and ordinary integer/floating inputs match.
HEX/UNHEX, including odd-length hex input and invalid digits, also match.
MatrixOne's BIT_COUNT('7x'), BIT_COUNT('-2tail'), and BIT_COUNT('abc') already use the MySQL-compatible prefix rule, returning 3, 63, and 0.
Root cause
CONV uses parseConvStrictString, which validates every character after the optional sign and raises an error as soon as a digit is invalid for the source base (source). BIN has only numeric overloads (registry), so string input reaches the ordinary strict string-to-integer cast instead of the prefix conversion used by MySQL.
Expected behavior
CONV should stop at the first invalid digit for the selected source base and use the parsed prefix, or zero if no digit is usable. BIN should apply the equivalent base-10 prefix conversion, matching MySQL.
Implemented in #28650. CONV/BIN now consume MySQL-compatible numeric prefixes for character and binary operands, including signs, leading whitespace, invalid-prefix zero, and empty-string NULL behavior. Added constant/column/binary regression coverage and MySQL 8.4 black-box validation.
Activity
fix(function): parse numeric prefixes in CONV and BIN (#28430)
XuPeng-SH commentedon Sep 11, 2026
Implemented in #28650. CONV/BIN now consume MySQL-compatible numeric prefixes for character and binary operands, including signs, leading whitespace, invalid-prefix zero, and empty-string NULL behavior. Added constant/column/binary regression coverage and MySQL 8.4 black-box validation.
fix(function): align CONV and BIN typed dispatch (#28650)
Ariznawlll commentedon Sep 12, 2026
已在最新官方 main
efb2c5084957ac90273a3f625668fc6a784562c4验证。CONV(123xyz,10,16)返回7B,BIN(7x)返回111,不再因尾随文本拒绝。\n- Happy path:有效数字前缀正确转换。\n- 边界控制:无有效前缀xyz123/abc返回0,不会误解析;会话后续查询正常。\n- 自动化:已加入 MOTR PR (aoe)[daily-update]: correct the memory node size #165,issue_28210_28211_28392_28454_28456_28460_28461_functions;TestIssue28392ConvBinNumericPrefixes当前 main 定向通过,MOTR 三轮复跑 12/12 case、252/252 statements 一致通过。\n\n测试通过。fix(function): parse numeric prefixes in CONV and BIN (matrixorigin#2…
fix(function): align CONV and BIN typed dispatch (matrixorigin#28650)
fix(function): parse numeric prefixes in CONV and BIN (matrixorigin#2…
fix(function): align CONV and BIN typed dispatch (matrixorigin#28650)
fix(function): parse numeric prefixes in CONV and BIN (matrixorigin#2…
fix(function): align CONV and BIN typed dispatch (matrixorigin#28650)