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
This consolidates overlapping explicit-CAST reports. Administrative consolidation does not claim that any defect is fixed. Original report bodies and discussions remain available at the links below.
Included reports
#30911 — CAST of non-numeric strings to numeric types errors instead of returning zero
Acceptance checklist
Preserve SIGNED, UNSIGNED and DECIMAL reproductions, including empty/whitespace input, numeric prefixes, valid values and warnings.
Existing PR: #30646. Its integer-CAST scope must not be treated as proof of coverage for the DECIMAL cases already consolidated into #30911 (including #30912). Keep those cases explicitly open in this checklist until validated.
Returns 0 with a warning: Truncated incorrect INTEGER value: 'x'.
Impact
Data-cleaning and legacy-report SQL that relies on MySQL's lenient casting fails outright instead of
yielding 0. Together with the error-code divergence tracked in #26684 (1064 vs 1146), this makes
error-driven fallbacks unreliable during a MySQL→MatrixOne migration.
Fresh-round SQL on the isolated MatrixOne service built from aeaa273daf588a9988ba423915d3ae6b8c82124a (binary SHA-256 450363d5ec5e693bdd7ded44565b3b0ab1addcb807d3f9569c5d5eedeb1486e4) confirms the SIGNED/UNSIGNED integer cases: invalid/empty/whitespace strings return 0 with warning 1292, 42tail returns 42 with a truncation warning, valid 42 and NULL return without warnings, and a filtered row set does not warn for the excluded invalid value. However, the consolidated DECIMAL case still reproduces: SELECT CAST('abc' AS DECIMAL(8,2)) returns Error 20301 (invalid decimal string) instead of a lenient numeric result. Therefore this issue remains open and is not a transfer candidate. Artifacts: round2-30646-cast-integer-sql.sql / round2-aeaa273-30646-cast-integer-sql.log; failing probe round2-30646-cast-decimal-probe.sql / round2-aeaa273-30646-cast-decimal-probe.log.
Regression and extended verification for #30417 (2026-10-27)
Verification Environment
MatrixOne main: 802376360c574f44aea23db5eef3cfcebf0527fd — perf: adapt bulk user AUTO_INCREMENT prefetch to observed demand (#31410). The freshly built runtime reported git_version() = 8023763.
Local topology: 2 CN / 1 TN / 1 LogService / Proxy. Proxy 26833, CN1 27151, and CN2 27152 were reachable.
MySQL CLI over TCP using the MySQL wire protocol. The conversion matrix ran through Proxy; the original SIGNED and invalid DECIMAL cases also ran directly on both CNs. A separate MySQL 8.0.46 instance provided the comparison.
What Was Covered
OK CAST('x' AS SIGNED) and CAST('x' AS UNSIGNED) returned 0 with warning 1292. CAST('abc' AS DECIMAL(8,2)) returned 0.00 with warning 1292.
OK Empty/whitespace text, numeric-prefix text, valid values, and NULL were checked for the relevant integer and DECIMAL casts against MySQL.
OK Under STRICT_TRANS_TABLES, the invalid-decimal INSERT was rejected and inserted no row. INSERT IGNORE and a loose-mode INSERT stored the expected values with warning 1292.
OK The original SIGNED and DECIMAL invalid-text queries returned the expected values and warning codes through both CN endpoints.
Not covered Binary-protocol prepared statements, the full distributed BVT suite, or engine parallel execution.
Findings
The original invalid-text conversion failure and the tested consolidated DECIMAL value/warning behavior are fixed on the pinned main. The merged fixes are PR #30646, commit c3e962df0a7efd7202ab9cbc37ce739f7c8a883a, for integer casts, and PR #31289, commit dfaed071d0fc7941c3544fb57496bf14f1d704cb, for explicit DECIMAL casts.
Two diagnostic differences observed in the extension tests are tracked separately: #31443 for the numeric-prefix warning's DOUBLE versus INTEGER text, and #31444 for strict-DML error code/SQLSTATE. Their separation does not assert that exact diagnostic parity has already been accepted as the compatibility contract.
MOTR / BVT Coverage
No MOTR case was added. The merged implementation PRs include regression coverage; this run used direct SQL and did not rerun the full BVT suite. No engine-parallel or MOTR parallel execution is claimed.
Final Conclusion
Fixed for the originally reported invalid-text conversion and the consolidated value/warning-code cases exercised above. The separate diagnostic differences remain open in #31443 and #31444. Large-data regression is not needed for this scalar conversion and diagnostic behavior.
Activity
test(bvt): align multi_insert_conditional & local_outer_reference res…
test(bvt): align func_cast/branch_set_lca with #30417 zero-warning ca…
test(bvt): make insert-all duplicate-error key deterministic under #3…
compile/plan: fix identifier escaping in ALTER COPY DROP, lenient int…
XuPeng-SH commentedon Oct 25, 2026
Fresh-round SQL on the isolated MatrixOne service built from
aeaa273daf588a9988ba423915d3ae6b8c82124a(binary SHA-256450363d5ec5e693bdd7ded44565b3b0ab1addcb807d3f9569c5d5eedeb1486e4) confirms the SIGNED/UNSIGNED integer cases: invalid/empty/whitespace strings return 0 with warning 1292,42tailreturns 42 with a truncation warning, valid42and NULL return without warnings, and a filtered row set does not warn for the excluded invalid value. However, the consolidated DECIMAL case still reproduces:SELECT CAST('abc' AS DECIMAL(8,2))returns Error 20301 (invalid decimal string) instead of a lenient numeric result. Therefore this issue remains open and is not a transfer candidate. Artifacts:round2-30646-cast-integer-sql.sql/round2-aeaa273-30646-cast-integer-sql.log; failing proberound2-30646-cast-decimal-probe.sql/round2-aeaa273-30646-cast-decimal-probe.log.fix(cast): keep strict-DML rejection for explicit bad-text DECIMAL ca…
test(cast): public strict-DML guard BVT and copyloopvar lint cleanup …
fix(cast): keep strict-DML rejection for explicit bad-text DECIMAL ca…
test(cast): public strict-DML guard BVT and copyloopvar lint cleanup …
test(cast): sync dtype/decimal golden for matrixorigin#30417 explicit…
fix(sql): handle invalid DECIMAL casts and quoted ADD INDEX backfills (…
slyunnn commentedon Oct 27, 2026
Regression and extended verification for #30417 (2026-10-27)
Verification Environment
main:802376360c574f44aea23db5eef3cfcebf0527fd—perf: adapt bulk user AUTO_INCREMENT prefetch to observed demand (#31410). The freshly built runtime reportedgit_version() = 8023763.2 CN / 1 TN / 1 LogService / Proxy. Proxy26833, CN127151, and CN227152were reachable.SIGNEDand invalidDECIMALcases also ran directly on both CNs. A separate MySQL8.0.46instance provided the comparison.What Was Covered
CAST('x' AS SIGNED)andCAST('x' AS UNSIGNED)returned0with warning1292.CAST('abc' AS DECIMAL(8,2))returned0.00with warning1292.NULLwere checked for the relevant integer andDECIMALcasts against MySQL.STRICT_TRANS_TABLES, the invalid-decimalINSERTwas rejected and inserted no row.INSERT IGNOREand a loose-modeINSERTstored the expected values with warning1292.SIGNEDandDECIMALinvalid-text queries returned the expected values and warning codes through both CN endpoints.Findings
The original invalid-text conversion failure and the tested consolidated
DECIMALvalue/warning behavior are fixed on the pinnedmain. The merged fixes are PR #30646, commitc3e962df0a7efd7202ab9cbc37ce739f7c8a883a, for integer casts, and PR #31289, commitdfaed071d0fc7941c3544fb57496bf14f1d704cb, for explicitDECIMALcasts.Two diagnostic differences observed in the extension tests are tracked separately: #31443 for the numeric-prefix warning's
DOUBLEversusINTEGERtext, and #31444 for strict-DML error code/SQLSTATE. Their separation does not assert that exact diagnostic parity has already been accepted as the compatibility contract.MOTR / BVT Coverage
No MOTR case was added. The merged implementation PRs include regression coverage; this run used direct SQL and did not rerun the full BVT suite. No engine-parallel or MOTR parallel execution is claimed.
Final Conclusion
Fixed for the originally reported invalid-text conversion and the consolidated value/warning-code cases exercised above. The separate diagnostic differences remain open in #31443 and #31444. Large-data regression is not needed for this scalar conversion and diagnostic behavior.
Ariznawlll commentedon Nov 30, 2026
QA 验收通过(最新 main)
版本与方法
c255da6778fac39bc53b5b9defaab3b6f945e4d6;关闭前再次解析仍为该 SHA。git_version()。覆盖与结果
CAST到 SIGNED、UNSIGNED、DECIMAL:非数字文本、空串/空白、数字前缀均返回对应零值或数字前缀;合法42精确返回 42/42/42.00,NULL 保持 NULL。STRICT_TRANS_TABLES下普通 INSERT 非数字值被拒绝,目标表仍为 0 行;INSERT IGNORE转为警告并写入零值。(0,0,0.00)。三轮日志 SHA256:
1cade7d2a34d51121c368790f4a4d4e14b46a9eb5d7153e19f28549f264336444dca8c01a8240a63414f390b8442f47ce7a3ea06bfe603607d83411071c9c3e7aaf388a89f6861151e3ba2bde487efbc5e623a5f80a4aafc2232dfd88bd6646dMOTR 回归
已推送到 matrixorigin/motr PR 374,head
d7715c5907ac73f967096343b1e394ec8486504f,用例为issue_30417_lenient_cast.py。评论时新 head 的 CI 均为 pending(queued),daily-42为 SKIPPED;不以 CI pending 代替上述真实 SQL 验收。