Skip to content

fix: support string math arguments - #30669

Closed
Lundomn wants to merge 100 commits into
matrixorigin:mainfrom
Lundomn:codex/issue-28487-string-math
Closed

Lundomn wants to merge 100 commits into
matrixorigin:mainfrom
Lundomn:codex/issue-28487-string-math

Conversation

@Lundomn

@Lundomn Lundomn commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • BUG

Which issue(s) this PR fixes:

Fixes #28487

What this PR does / why we need it:

Preserves the source meaning of HEX and BIT literals when string expressions flow into numeric functions. For example, a selected X'31' remains numeric 49 through ABS or SQRT, while ordinary text '1' remains 1. CASE, IF/IFF, COALESCE, derived projections, set/group representatives, recursive CTEs, dependent scalar results, prepared statements, SET, and SELECT INTO carry the selected source kind alongside the value from one evaluation of the original expression.

The kind travels as an ordinary BOOL output in the existing execution plan. It does not add numeric provenance flags to vectors or a trailer to batch formats. CTAS, defaults, INSERT/INSERT SELECT, UPDATE, and rollback/retry materialization store ordinary values and end the execution-only source marker.

Numeric value programs, private plan IDs 605/606, and nonempty result-kind layouts require MORPC v130, with local fallback below or for unknown worker capability and rejection of unsupported remote peers. This floor is separate from upstream LOAD IGNORE v125, VIEW metadata v126, index/vector features v127, mixed JSON v128, and JSON string-consumer v129. SessionInfo fields 24/25 carry the compatibility mode and sender contract marker.

The candidate is 3bc4c3731412819bc8dc27fa3a8a02ecc49962c4, based on e19f698de0fc52a60f60f2ff689d6d16a5100334. Local validation includes:

  • Full pkg/sql/plan, pkg/sql/plan/function, pkg/frontend, and all ^TestPrepared tests in pkg/embed passed on 3234f55d; the final generate-series metadata-only change was then verified by the plan parameter-info test, the public explicit-CHAR prepared/wire-type regression, and the full TestPreparedSpecializedDomains suite on this candidate.
  • MORPC admission/protocol boundaries, rollup and SELECT INTO plan guards, scalar/dependent ownership and cardinality tests under race, and public relational/materialization plus an observed remote two-CN send path under race passed on the rebased candidate before the final metadata-only change.
  • TestPreparedNumericTemporalContracts and TestIssue28680IgnoreConversionExecutionBoundaries passed on 3234f55d.
  • Focused expression benchmark: paired CAST9 with the comparison policy used +192 B/op and +3 allocations versus the current-binder CAST2 comparison path, with elapsed time 22.2–28.5% higher across two runs. This is a prebuilt-batch executor microbenchmark, not an end-to-end or historical comparison.

Exact commands, log paths, CI snapshot findings, and validation limits are recorded in /Users/ljy/.codex/issue-to-pr/matrixone/pr-30669-rebase/evidence-index-3bc4c373.md. New-head GitHub CI is pending.

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

@mergify mergify Bot added the kind/bug Something isn't working label Oct 20, 2026
@matrix-meow matrix-meow added the size/XXL Denotes a PR that changes 2000+ lines label Oct 20, 2026
@Lundomn
Lundomn force-pushed the codex/issue-28487-string-math branch from 928bb03 to 25938d0 Compare October 20, 2026 11:32
@XuPeng-SH

XuPeng-SH commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 25938d0e6691f8dc3632e1ba24217df5a74e9b34

"interrupted"

@XuPeng-SH

XuPeng-SH commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-xupeng · done

Commit: 25938d0e6691f8dc3632e1ba24217df5a74e9b34

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-xupeng · review

Commit: 25938d0e6691f8dc3632e1ba24217df5a74e9b34

Assessment: request_changes

The mandatory design-first gate lacks a traceable approval record. Implementation acceptance remains pending.

Model: gpt-6-astra / xhigh

Session: 01a14d34-4e51-79a3-a62d-6c9c16279dc8 · slot 0 · generation 0

  • P2 docs/design/string-math-coercion.md:5: This change introduces a SQL mode, changes default numeric conversion, and adds vector provenance and distributed wire contracts. These trigger the repository's mandatory design review requirements.
    Impact: The behavior note does not identify an approved design revision or link a distinct design review decision. Obtain and record that decision, linking the exact reviewed revision and implementation PR, before proceeding with implementation acceptance.
    Evidence: The complete document at blob 286561b62472c082d58f59442b4bb1f5a06cb63e contains no approval record. The supplied PR body links only the document; evidence.json contains no reviews or review comments. .agents/skills/mo-dev/references/feature-design-review.md:63-94 requires a traceable reviewed revision and approval, and explicitly blocks implementation acceptance when this gate is unmet.

Validation:

  • Verified the pinned HEAD, merge-base, unchanged source, and frozen patch equivalence after newline normalization. git diff --check passed. Evidence: scope-audit.json, scope-audit-v2.log, and checks/1792520633993401150-4.json under the assigned attempt directory; receipt exit code 0 and exact HEAD with an empty source delta.

  • The initial audit failed on newline-sensitive patch comparison, not product behavior. Its script, scope-audit.log, and checks/1792520607008043019-4.json are retained.

  • Read the complete design document, supplied PR description and comments, and representative production changes establishing the design-gate triggers. local_validation is empty.

Limitations:

  • The applicable mo-self-review skill states: “Missing/unapproved or failed design makes the decision REQUEST_CHANGES and short-circuits full implementation polishing.” Full implementation, test-quality, and runtime review remain open.

  • No Go tests or native builds were run. Author-reported CI results were not independently reconciled and are not claimed as verified passes. Missing execution evidence is not the basis of this finding.

@mergify

mergify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is closed, so it cannot be queued. Reopen it to get the box back.

This branch had an error being deployed

1 failed 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 size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Compatibility]: exact math functions misparse character numeric operands

6 participants