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]: POWER, EXP overflow and COT domain errors abort queries instead of returning NULL #28137
在 MatrixOne main 99ed717b769e261b842c2f17345bd65865fc1470,部分数值函数对定义域外或溢出输入抛出错误,而不是返回 NULL:
SELECT POWER(-1, 0.5); -- data out of range ... pow(-1,0.5)SELECT POWER(0, -1); -- data out of range ... pow(0,-1)SELECT EXP(1000); -- data out of range ... exp(1000)SELECT COT(0); -- data out of range ... cot(0)
Regression and extended verification for #28137 (2026-09-09)
Verification Environment
MatrixOne baseline: latest local origin/main at af965c3e4d86ec218de05b585dbafbedb10aa1ae — fix(function): align QUOTE with MySQL (#28443).
Related fix: PR #28375, fix: return NULL for POWER EXP and COT arithmetic failures, merged as 80d214bef28a33f81020b76b2ed9280a6e7654b9; the fix commit is an ancestor of the baseline above.
Topology: a freshly built standalone MatrixOne deployment from the baseline, with one mo-service hosting LOG, TN, and one CN; no Proxy and no second CN were used.
Endpoints: CN MySQL 127.0.0.1:6001; TN 127.0.0.1:19000; Log/HAKeeper 127.0.0.1:32001.
Clients and protocol: mysql CLI and MOTR/PyMySQL, both over MySQL wire protocol via TCP to 127.0.0.1:6001.
What Was Covered
OK: Original arithmetic failures return NULL: POWER(-1, 0.5), POW(-2, 0.5), POWER(0, -1), EXP(1000), and COT(0).
OK: Boundary controls cover POWER(2, 1024), POWER(2, -1075), EXP(-1000), and the original domain/overflow boundaries.
OK: Explicit NULL inputs to POWER, EXP, and COT remain NULL.
OK: Mixed three-row vector evaluation proves a bad row is row-local and does not abort valid later rows; COUNT, SUM, and a WHERE ... IS NULL filter observe the resulting NULL values correctly.
OK: A CTAS result exposes nullable derived columns, and a nullable target table accepts the mixed POWER/EXP/COT result set.
OK: A prepared statement is executed first with invalid values and then with valid values in the same session.
OK: Direct MySQL-protocol unhappy-path verification confirms a NOT NULL target rejects a derived NULL with ERROR 3819, and the multi-row INSERT ... SELECT remains atomic with COUNT(*) = 0 afterward.
OK: The fix PR's BVT coverage also exercises constant and vector forms, casts, IF/CASE, aggregate/filter behavior, nullable and NOT NULL DML, prepared reuse, and CTAS nullability.
Not covered: multi-CN, Proxy, JDBC, and TKE deployment paths; this scalar-function defect has no evidence of topology- or protocol-specific behavior.
PR #28375 supersedes the earlier ERROR 1690 contract considered in the prior assessment. On the current baseline, invalid POWER, EXP, and COT arithmetic yields a row-local NULL; valid rows and subsequent prepared executions continue normally. Nullability metadata and DML behavior are consistent with that contract.
Large-data regression is not required. The defect is scalar arithmetic and null propagation, not dependent on row count, block/batch boundaries, memory/spill, concurrency, skew, network transfer, or resource scale. The mixed three-row vector case is the minimal stable data set that covers both valid and failing rows without adding unrelated CI cost.
MOTR / BVT Coverage
Added MOTR regression: suites/14_issue_regression/t/issue_28137_null_arithmetic.test and suites/14_issue_regression/r/issue_28137_null_arithmetic.result.
Recorded once and replayed twice against the freshly built baseline: each run passed 23 statements with 0 failures.
Fixed. The current main contains the related fix, and the original scenario plus functional, unhappy-path, boundary, nullability, prepared-statement, and targeted regression coverage all pass. This comment supersedes the prior Out of scope conclusion; the intended contract is now explicit. Large-data regression is not needed for the reasons above.
Activity
fix: preserve POWER, EXP, and COT error semantics (#28155)
6 remaining items
fix: return NULL for POWER EXP and COT arithmetic failures (#28375)
Lundomn commentedon Sep 8, 2026
转 QA 测试:PR #28375 -> Issue #28137
80d214bef28a33f81020b76b2ed9280a6e7654b9,当前main已指向该提交。phase/testing,负责人已分配为slyunnn。请重点验证以下 Issue 要求及 PR #28375 的变更:
POWER(-1,0.5)、POWER(0,-1)、EXP(1000)、COT(0)在当前 main 返回 NULL,不再使整条语句失败。POWER/POW、EXP、COT的可空元数据和规划行为,包括IS NULL、CTAS、NOT NULL 源列。pkg/sql/plan/function相关测试及 PR 描述中的 POWER/EXP/TRIG/数学函数 BVT;记录测试环境、SQL 结果、错误/警告与补测情况。建议环境:当前
mainmerge commit80d214bef28a33f81020b76b2ed9280a6e7654b9,优先标准 TKE/多 CN + Proxy 验收,并补充本地单机 MySQL 协议验证(如 6001)。注意:PR 明确这是 MatrixOne 采用 NULL 语义的行为变更,并不声称恢复 MySQL 8.4 的 error 行为。请 QA 记录该兼容性契约差异;如产品要求严格对齐 MySQL,需要先由产品/RD 明确最终预期。通过后由 QA 关闭 Issue;若失败或契约未决,请保持 open 并记录补修/澄清项。
slyunnn commentedon Sep 9, 2026
Regression and extended verification for #28137 (2026-09-09)
Verification Environment
origin/mainataf965c3e4d86ec218de05b585dbafbedb10aa1ae—fix(function): align QUOTE with MySQL (#28443).fix: return NULL for POWER EXP and COT arithmetic failures, merged as80d214bef28a33f81020b76b2ed9280a6e7654b9; the fix commit is an ancestor of the baseline above.mo-servicehosting LOG, TN, and one CN; no Proxy and no second CN were used.127.0.0.1:6001; TN127.0.0.1:19000; Log/HAKeeper127.0.0.1:32001.mysqlCLI and MOTR/PyMySQL, both over MySQL wire protocol via TCP to127.0.0.1:6001.What Was Covered
NULL:POWER(-1, 0.5),POW(-2, 0.5),POWER(0, -1),EXP(1000), andCOT(0).POWER(2, 3)returns8; finiteEXP(709)andCOT(1)return non-NULLvalues.POWER(2, 1024),POWER(2, -1075),EXP(-1000), and the original domain/overflow boundaries.NULLinputs toPOWER,EXP, andCOTremainNULL.COUNT,SUM, and aWHERE ... IS NULLfilter observe the resultingNULLvalues correctly.CTASresult exposes nullable derived columns, and a nullable target table accepts the mixedPOWER/EXP/COTresult set.NOT NULLtarget rejects a derivedNULLwithERROR 3819, and the multi-rowINSERT ... SELECTremains atomic withCOUNT(*) = 0afterward.IF/CASE, aggregate/filter behavior, nullable andNOT NULLDML, prepared reuse, andCTASnullability.NULLcontract for these arithmetic failures rather than upstream MySQL's error behavior.Findings
PR #28375 supersedes the earlier
ERROR 1690contract considered in the prior assessment. On the current baseline, invalidPOWER,EXP, andCOTarithmetic yields a row-localNULL; valid rows and subsequent prepared executions continue normally. Nullability metadata and DML behavior are consistent with that contract.Large-data regression is not required. The defect is scalar arithmetic and null propagation, not dependent on row count, block/batch boundaries, memory/spill, concurrency, skew, network transfer, or resource scale. The mixed three-row vector case is the minimal stable data set that covers both valid and failing rows without adding unrelated CI cost.
MOTR / BVT Coverage
suites/14_issue_regression/t/issue_28137_null_arithmetic.testandsuites/14_issue_regression/r/issue_28137_null_arithmetic.result.23statements with0failures.test/issue-28137-null-arithmetic, commitfc7957c. No issue-specific PR was created.Final Conclusion
Fixed. The current
maincontains the related fix, and the original scenario plus functional, unhappy-path, boundary, nullability, prepared-statement, and targeted regression coverage all pass. This comment supersedes the priorOut of scopeconclusion; the intended contract is now explicit. Large-data regression is not needed for the reasons above.fix: preserve POWER, EXP, and COT error semantics (matrixorigin#28155)
fix: return NULL for POWER EXP and COT arithmetic failures (matrixori…
fix: preserve POWER, EXP, and COT error semantics (matrixorigin#28155)
fix: return NULL for POWER EXP and COT arithmetic failures (matrixori…
fix: preserve POWER, EXP, and COT error semantics (matrixorigin#28155)
fix: return NULL for POWER EXP and COT arithmetic failures (matrixori…
fix(function): return row-local NULL for fractional powers of negativ…