Skip to content

fix(function): name INTEGER in explicit CAST(text AS SIGNED/UNSIGNED) warnings - #31844

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
MatrixAdventurer:fix-31443-cast-integer-warning
Oct 30, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
MatrixAdventurer:fix-31443-cast-integer-warning

Conversation

@MatrixAdventurer

@MatrixAdventurer MatrixAdventurer commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • BUG

Which issue(s) this PR fixes:

Fixes #31443

What this PR does / why we need it:

SELECT CAST('42tail' AS SIGNED); SHOW WARNINGS; returned 42 and warning code 1292, but the message said Truncated incorrect DOUBLE value: '42tail'. MySQL 8.0 says Truncated incorrect INTEGER value: '42tail' for an explicit CAST(... AS SIGNED/UNSIGNED).

Cause: strToSignedWithProc / strToUnsignedWithProc used the shared numeric-coercion warning helper, which always names DOUBLE.

Fix (func_cast.go +17/-3): the helper takes the type name; explicit integer casts pass INTEGER, implicit coercion keeps DOUBLE. Value, warning code and the other warning paths are unchanged.

Tests

  • New UT cast_integer_warning_test.go: explicit cast of '42tail' to BIGINT and BIGINT UNSIGNED gives 42 and the INTEGER message. RED on main (DOUBLE message), GREEN here. go test ./pkg/sql/plan/function/... passes.
  • New BVT function/cast_text_integer_warning.sql: main 7/10, PR 10/10.
  • BVT dirs PR vs main: function same failures (foreign_exttab 2, table_func_table_changes 14, local env), dtype 0, expression 0, prepare 0. No existing golden changes.

Merge Danger

Low. Warning text only.

本操作由 LW 授权的 Grok Bot 智能体执行。

… warnings

An explicit CAST of numeric-prefix text to SIGNED/UNSIGNED returned the right
value and warning code but described the conversion as DOUBLE
("Truncated incorrect DOUBLE value"). MySQL names it INTEGER. Implicit
numeric coercion keeps DOUBLE.

Fixes matrixorigin#31443
@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 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 1b9395d2c948e857d8d9bdd0b71ec267f6ecf788

Review completed. Read the assessment.

@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.

mo-bot review · mo-bot-local · review

Commit: 1b9395d2c948e857d8d9bdd0b71ec267f6ecf788

Assessment: approve

The fix correctly names INTEGER in explicit text-to-integer cast warnings while preserving values, warning codes, and other conversion paths. No actionable findings remain.

Model: gpt-6-astra / xhigh

Session: 01a1869d-999c-7481-b340-ae4a63e8cee4 · slot 1 · generation 2

Validation:

  • Reviewed the complete delta, affected owners and consumers, linked issue, and all discussion items.

  • Isolation preflight and 11 focused cast/diagnostic tests passed.

  • The new regression test failed as expected against a merge-base implementation overlay, reproducing the old DOUBLE message.

  • Supplied exact-head CI reports successful UT, static analysis, and both distributed BVT groups.

  • Verified receipts against retained logs, native-input provenance, discussion coverage, and unchanged source. Evidence recorded in validation-summary.json.

Limitations:

  • Full UT and distributed BVT rely on supplied CI results; raw external logs were unavailable.

  • No fresh MySQL comparison was run; the supplied linked issue provides the diagnostic oracle.

@mergify

mergify Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@aunjgr aunjgr 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.

Reviewed the explicit and implicit integer-conversion warning paths and their SQL regression coverage.

@mergify mergify Bot added the queued label Oct 30, 2026
@mergify

mergify Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🚫 Left the queue

1 h 20 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Fri 30 Oct, 11:32 · rule main · triggered by rule Automatic queue on approval for main
  • ⏹️ Testing stopped · in place
  • 🚫 Left the queue 12:52 · a28b403

Reason

Pull request #31844 has been dequeued

Pull request from fork cannot be queued. This pull request comes 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.

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

Times in UTC · dashboard · how the merge queue works

@XuPeng-SH
XuPeng-SH merged commit d48cfce into matrixorigin:main Oct 30, 2026
19 of 22 checks passed
@mergify mergify Bot added dequeued and removed queued labels Oct 30, 2026

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Compatibility]: CAST numeric-prefix text AS SIGNED reports DOUBLE instead of INTEGER in warning

4 participants