Repository navigation
Description
Origin and scope
Follow-up from the independent review of #29462 at 386c1434232af5ccf153b7c2d23e1240be90d021, compared with base b06ff850d4c54af2aeb920136f6e39d6b88f940b. Tracked separately at the maintainer's request for issues below the main query-regression severity.
Confirmed problem
The PR adds the YEAR → BIT execution case in yearToOthers. The base implementation has no such case and returns unsupported cast from year to BIT.
The existing expression capability mechanism does not recognize this new execution signature. A focused white-box test at the reviewed head:
- Binds
castfrom a YEAR column expression to a BIT(64) target throughBindFuncExprImplByPlanExpr. - Calls
RequiredRemoteExpressionFeatures: every feature is false. - Calls
RequiredPersistedExpressionProtocolVersion: returns 0. - Uses the existing
expressionProtocolTestCompilefixture, places that expression in a remote projection, sets the mocked destination version toMORPCVersion100, and callsencodeRemoteScope: succeeds, rather than rejecting the unsupported destination.
Thus a current planner can transmit a valid new expression to an old worker that cannot execute it. The current-version stored-procedure regression test passing does not prove mixed-version compatibility. The expression floor also fails to identify the new capability for persisted expressions.
Impact and evidence boundary
Mixed-version execution can fail for this newly supported cast. This is a compatibility gap, not demonstrated data corruption. The send-path result above was executed in a white-box test; an actual mixed-version cluster was not run. The old executor's missing implementation was verified against the exact base. No claim is made that every ordinary query selects a remote projection.
Minimal fix direction
Prefer lowering through already supported numeric casts if their YEAR/BIT semantics can be proven equivalent. Otherwise extend the existing expression capability mechanism, including placement, send recheck, receive validation and persisted-expression floor. Do not introduce a second version registry or special execution route.
Acceptance
- A YEAR-column-to-BIT expression cannot reach an unsupported worker; supported workers still execute it.
- The persisted-expression floor reflects any genuinely new execution requirement, or lowering removes that requirement.
- Cover NULL, representative YEAR values and BIT width boundaries with compact semantic tests.
- Exercise old/new destination capability using existing protocol fixtures; include a positive current-version control.
- Preserve the stored-procedure regression fixed by fix: restore prepared TPCC filter selectivity with per-binding proof #29462.
Activity
XuPeng-SH commentedon Sep 29, 2026
Fixed by PR #29462 commit 95e565b. CAST(YEAR AS BIT) now requires the existing MORPC v101 expression contract for persisted plans, placement, send-time destination validation and receive-time validation. Local protocol tests covered v100 rejection, v101 acceptance and a non-YEAR CAST control; plan, compile, pb/plan and function packages passed. A real mixed-version cluster was not rerun. Commit-bound review: #29462 (review).
fix: restore prepared TPCC filter selectivity with per-binding proof (#…