fix cast digital string#25449
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
I did not find a blocker in this cast fix.
The new numeric-token parser consistently handles radix prefixes/signs for signed, unsigned, and decimal casts, while keeping the documented non-strict float behavior unchanged. The added regression coverage also exercises the invalid-sign combinations, negative-zero unsigned cases, and the new prefixed decimal paths.
Merge Queue Status
This pull request spent 28 minutes 31 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonThe merge conditions cannot be satisfied due to failing checks Failing checks:
HintYou may have to fix your CI before adding the pull request to the queue again. Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #25243
#25265
What this PR does / why we need it:
扩展了 matrixone的数字字符串转数字. 与postgresql的行为接近, 也常识接近.
与mysql 不同, mysql都是返回0, 违背常识.
在 func_cast.go 中新增统一的严格 numeric token 解析逻辑。
支持前缀:
0123 这类仅前导 0 的字符串仍按十进制解析。
+ / -只允许作为最外层最终符号。+/-后面的 body 必须能完整按目标类型解析,否则报错。拒绝非法符号组合:
+-1++1--1- 1+ 1unsigned 保持规则:
decimal cast 支持 radix 前缀,并按目标 scale 输出: