Skip to content

add SIGN - #24650

Merged
XuPeng-SH merged 10 commits into
matrixorigin:3.0-devfrom
daviszhen:0527-add-sign
May 28, 2026
Merged

add SIGN#24650
XuPeng-SH merged 10 commits into
matrixorigin:3.0-devfrom
daviszhen:0527-add-sign

Conversation

@daviszhen

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue ##24481

What this PR does / why we need it:

增加sign函数. 判断数字的符号位

@daviszhen
daviszhen requested a review from a user May 27, 2026 10:36
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found one blocking correctness issue in the current SIGN() registration.

SIGN is wired with fixedTypeMatch and overloads for int64, uint64, float64, decimal64, and decimal128 only. For char/varchar inputs, the implicit-cast rules prefer int64 over float64 (type_check.go: varchar -> int64 has lower cost than varchar -> float64), so string arguments resolve to the integer overload.

That makes fractional numeric strings behave incorrectly. For example, SIGN('0.5'), SIGN('-0.3'), and SIGN('123.123') will not take the float path; they go through string->int casting instead (func_cast.go uses strconv.ParseInt for that path), which is MySQL-incompatible and can return the wrong result or an invalid-arg error instead of 1 / -1.

So the overload set / matcher still needs adjustment before approval, and the SQL tests should cover string inputs like SIGN('0.5'), SIGN('-0.3'), and SIGN('123.123').

@mergify

mergify Bot commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-05-28 10:08 UTC · Rule: release-3.0
  • ✅ Checks started · in-place
  • 🚫 Left the queue — 2026-05-28 10:37 UTC · at cb5816eb2f0fea777b97e50eebcf568441bafa98

This pull request spent 28 minutes 22 seconds in the queue, with no time running CI.

Reason

The pull request can't be updated

This pull request seems to come from a fork, and Mergify needs the author's permission to update its branch.
The author needs to enable "Allow edits from maintainers" on this pull request, or update the branch manually.

Hint

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

@XuPeng-SH
XuPeng-SH merged commit 7bb711a into matrixorigin:3.0-dev May 28, 2026
1 of 3 checks passed

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/enhancement size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants