Repository navigation
[4.2-dev] fix: preserve prepared numeric semantics for BIT casts - #26754
mergify[bot] merged 10 commits into
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.
Post-push review of exact head fbc2ecf found that the provenance model still closes only the integer subset of the underlying text-tunnel bug. A real database/sql binary prepared INSERT binding float64(5) to BIT(64) succeeds but stores 53 (ASCII 0x35), while numeric semantics require 5. This follows the same public path as setLong: MYSQL_TYPE_DOUBLE is decoded numerically, converted to canonical text, then loses its source category and falls into string-to-BIT byte semantics. Simply adding FLOAT/DOUBLE to isInteger would be wrong because floating BIT conversion rounds and rejects negative values instead of preserving a two-complement integer pattern; DECIMAL/NEWDECIMAL also have their own truncation/range rules. Please preserve the numeric source category (integer, floating, decimal) across the existing process/remote metadata boundary and dispatch to the corresponding BIT semantics, while keeping MYSQL_TYPE_BIT and string/blob types byte-oriented. Add a public DOUBLE prepared control plus typed classification/cast controls that distinguish integer -1, float -1, decimal fractions, and string "5".
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep-reviewed exact head c0dda620ae76 after the final push in a fresh worktree. The earlier integer-only blocker is closed at the root: prepared values retain their source conversion category across binary execute, SQL EXECUTE USING, direct user-variable evaluation, Process/remote transport, reuse, and shard version gating. Integer, float, Decimal, and Boolean inputs now follow their corresponding typed BIT semantics, while MYSQL_TYPE_BIT and strings remain byte-oriented; INSERT IGNORE and signed BIT(64) behavior stay aligned with the direct numeric paths.
The post-push review also checked ownership/error cleanup, legacy metadata decoding, mixed-commit protection, malformed Decimal input, null/default zero-allocation paths, and stale metadata reset. Full affected-package tests, vet, lint, diff checks, focused metadata/cast tests, and the real database/sql embedded regression pass. No blocking findings remain.
Merge Queue Status
This pull request spent 22 seconds in the queue, including 2 seconds running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #26740.
Follow-up for #26728 and backport of #26748 to
4.2-dev.What this PR does / why we need it:
MatrixOne transports prepared parameters internally through a transient text vector. That transport erased the source conversion semantics before assignment to
BIT(M), so the same value could be interpreted as ASCII bytes instead of a number.This PR preserves the source conversion category across binary COM_STMT_EXECUTE, SQL EXECUTE USING, normal user-variable evaluation, process serialization, remote compile, and shard reads:
The metadata uses the existing process transport with backward decoding for legacy/no-metadata and the prior integer-only layout. Mixed-commit shard reads use the versioned method and are rejected before execution.
Validation