Repository navigation
refactor: add integer parameter binding contract - #28989
Conversation
# Conflicts: # pkg/defines/const.go # pkg/pb/plan/string_literal_form.go # pkg/sql/plan/base_binder.go # pkg/sql/plan/persisted_ip.go # pkg/sql/plan/utils.go
# Conflicts: # pkg/defines/const.go
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.
Deep review(head 12f2f56)
结论:REQUEST_CHANGES。发现 1 个 P2 契约问题;未确认 P0/P1。另有独立的设计审批门槛未关闭。
- [P2] 未物化 RuntimeType 的 COM_STMT 参数被一概解释为 TEXT。见 visit_plan_rule.go:3720-3723。现有 DATE/TIME/DATETIME/TIMESTAMP 的 binary protocol payload 会解码为日期字符串,但 binaryProtocolPrepareParamDomains 没有 temporal 分支,导致 HasRuntimeType 不设置;新 rebind 将其固定为 TEXT,CAST5 会按整数前缀解析,未使用 sidecar 中的真实协议类型。
最小反例:prepare substring_index(a.b.c,.,?),以 MYSQL_TYPE_DATE 绑定 2024-01-02。该路径可能把 count 解释为 2024 并返回整个字符串,而 typed SQL 输入会被 source allowlist 拒绝,导致同一 source type/value 因客户端协议不同而出现不同结果。建议在物化/rebind 边界保留真实协议类型,并补 raw DATE/TIME packet 与 VAR_STRING 对照测试。
其余数值边界、NULL、类型切换、prepared 生命周期、planner 消费者、远端 placement 和资源路径未发现新的确定性缺陷。
此外,设计审批记录仍为 Pending:design 文档 351-357。head 文档已补 v85 修订,但 PR 正文仍锁定旧设计 revision 2645ef7;请更新精确 revision 并记录审批。
CI build、Ubuntu UT、SCA、coverage、multi-CN BVT 和 CI Required 已通过;upgrade compatibility jobs skipped,不能据此宣称跨版本升级/回滚实测通过。CI:https://github.com/matrixorigin/matrixone/actions/runs/35223986744
aptend
left a comment
There was a problem hiding this comment.
Blocking findings: receiver admission does not validate private CAST 5–8 signatures, and the approved mixed-version design still gives contradictory v84/v85 rollout boundaries. I reproduced the receiver gap with a negative unit counterexample: a v85 pipeline carrying CAST 5 over a DATE source was accepted by validateRemoteExpressionPipelineProtocol (nil error), even though only CAST 8 owns temporal permission. Targeted integer conversion, planner, compile protocol, and frontend temporal tests otherwise pass at this exact head.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review (Astra medium, exact head 689d97a)
REQUEST_CHANGES.
P1 — Mandatory design approval is still pending
At docs/design/CLAUDE_INTEGER_PARAMETER_BINDING_CONTRACT_DESIGN.md:353, the design approval remains Pending. Line 355 supersedes the approval of 0fb3d35, and the current PR review record contains no approval of the replacement design.
This change introduces private execution identities and changes distributed and persisted-expression compatibility, triggering the mandatory design-first gate. Please obtain a traceable maintainer approval of the exact revised design, covering the v85 compatibility and persistence contracts, before implementation approval.
No additional implementation finding is being asserted because the missing design approval blocks the required full review gate.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review (Astra medium, exact head cc6e0ab)
APPROVE.
Reviewed all 34 changed files against base 780ef93. No concrete blocking findings remain after tracing conversion boundaries, prepared-plan reuse, relevant consumers, remote/catalog admission, cleanup/error paths, and test architecture.
The maintainer approval covers design revision 0fb3d35. Subsequent v85 documentation corrections and receiver signature checks conform to that design.
Reused exact-head CI run 35317544680: build, Ubuntu UT, static analysis, coverage, and both multi-CN BVT jobs passed. Upgrade jobs were skipped; this review does not claim end-to-end upgrade/rollback validation.
What type of PR is this?
Which issue(s) this PR fixes:
issue #28977
Design review
0fb3d35f84c0e919ff76d10e6a1c0d1d3b4f6252, approved by fengttt (GitHub review 5239953805, 2026-09-17).What this PR does / why we need it:
Establishes the foundation for parameter-owned integer coercion and migrates only SUBSTRING_INDEX as the representative consumer.
The integer-parameter contract uses MORPC v85. The merged base owns v82 for the fulltext2 probe-tail contract, v83 for bounded COALESCE string domains, and v84 for extended discrete percentile input types; all independent gates are preserved and the latest protocol is v85. This supersedes older issue/PR text that referred to v76 or v84 for integer coercion.
Source-dependent bit/temporal consumer rebinding and all remaining function migrations are intentionally deferred to #28978, #28979, #28980, and #28981. Those migrations must reuse the approved contract and return to design review if they need new semantics, identities, protocol versions, or compatibility mechanisms.
Validation:
make buildpassed on the original implementation revision;mainand resolving the MORPC allocation conflict,pkg/sql/plan/function,pkg/sql/plan, andpkg/sql/compilepassed with the repository CGo wrapper.Latest regression validation (
515cc5bdc3, Go 1.26.4, Darwin/arm64):typecheckand atomic coverage; compile/function/pb-plan/defines suites passed;-racewith coverage, including optimized column/subquery peers, explicit CHAR boundaries, bare GROUP BY/UNION parameters, and aggregate/window sources;TestCTASDivisionByZeroalso passed locally under-race; this does not establish the cause of its earlier CI timeout;func_string_substringindex.test: reproduced the exact five overflow mismatches, generated/reviewed the new error expectations, then passed 81/81 twice on one instance;integer_parameter_coercion.sql41/41 andfunction_substring_index.sql97/97;Latest temporal regression validation (
689d97a74f, Go 1.26.4, Darwin/arm64):.499999and.500000;pkg/frontendand the complete issue fixture passed; modified frontend production blocks covered 13/14 statements;optools/TestUTHeartbeatStopDuringSleepRegistration/int(exit status 93); no passing remote CI is claimed.Latest receiver-admission validation (
917fb76310, Go 1.26.4, Darwin/arm64):pkg/sql/compile, and fullpkg/pb/planpassed; new admission statements covered 21/21;<81to<85;Latest source-allowlist validation (
cc6e0abd4e, Go 1.26.4, Darwin/arm64):pkg/sql/compile, fullpkg/pb/plan, vet, and incremental lint passed; changed production statements covered 2/2.