Skip to content

fix(plan): preserve ENUM and SET identity for ordering and aggregates - #29177

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/issue-28222-28692
Sep 21, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/issue-28222-28692

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Fixes #28222
Fixes #28692

What this PR does / why we need it:

Preserve ENUM ordinals and SET bitmaps for numeric consumers instead of passing display strings to SUM/AVG. Transparent projections carry a hidden raw value only after proving the relational path preserves identity. Unary SUM/AVG select numeric input before overload lookup and aggregate DISTINCT; ordinary VARCHAR aggregate behavior and BIT handling remain unchanged.

SET ordering after GROUP/DISTINCT and LIMIT-materialized outputs uses the canonical bitmap of the surviving display. DISTINCT computes its sort key after equality reduction, so raw values with the same display do not become separate groups. Numeric casts, window/GROUP_CONCAT ordering and FIND_IN_SET share the relevant boundary policy. Existing ambiguous ENUM order guards and unrelated legacy set-operation cast behavior remain unchanged.

The proof is query-local and hidden slots are reused per source output. No new executor/function IDs, aggregate formats, protocol gates, persistent metadata or runtime services are introduced. MySQL reference evidence is 8.4.10; original issues cited 8.3.0. Same-block grouped ambiguous SET numeric representative semantics remain explicitly unsupported, rather than selecting an arbitrary representative.

Validation:

  • Focused planner tests cover raw lineage, canonical conversion, DISTINCT equality, hidden-slot reuse, failed-proof non-mutation, unsigned/decimal/double casts and legacy controls.
  • Entire planner and function packages passed (-p 2); final planner rerun and current-source vet/gofmt passed.
  • Independent GPT-6 medium design, source review and final overall evidence reconciliation passed with no remaining blockers.
  • Final rebuilt-service normal BVT result comparisons passed twice without restart on isolated port6002: SET87/87 and ENUM/SET numeric45/45 each run, zero failures/ignored/abnormal. Between rounds, before the next harness cleanup, only the seven built-in databases remained; the post-repeat check was identical. The task service then shut down cleanly. Earlier mis-targeted runner results are excluded from validation evidence. No CI results are claimed.

@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 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PASS — deep review using GPT-6 Astra / medium of 782d2f0.

Reviewed all PR hunks and ENUM/SET provenance, numeric aggregation, ordering, projection/equality boundaries, casts/assignments and metadata consumers. No verified P0/P1/P2 blockers.

Verified exact-head CI: numeric 45/45, SET 87/87, ALTER CHANGE 923/923 and ALTER MODIFY 764/764, with zero failures/ignored/abnormal results. Coverage was not a gate. Base-only changes and the dirty local worktree were excluded.

@XuPeng-SH
XuPeng-SH merged commit f9d89ab into matrixorigin:main Sep 21, 2026
16 of 19 checks passed
@XuPeng-SH
XuPeng-SH deleted the codex/issue-28222-28692 branch September 21, 2026 01:46
XuPeng-SH pushed a commit that referenced this pull request Oct 30, 2026
…s and JSON conditions (#31492)

## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Related to #30931
Related to #30930
Related to #30932

## What this PR does / why we need it:

Consolidated group #30931: ENUM/SET truthiness, BIT value literals, JSON
IF/CASE conditions. Each defect traces to a surface consuming display
text or a strict cast where the stored payload was required.

Root causes
- **#30931 (master)** ENUM/SET column references bind as display calls;
boolean contexts string-parsed labels: `IF(e,1,0)`/`IF(s,1,0)` returned
0 for every nonzero ordinal/bitmap, `WHERE e`/`s` and `e AND 1` failed
with 'a' is not a valid bool expression', grouped/DISTINCT boundaries
lost storage identity, and numeric SET IN/NOT IN comparisons re-parsed
labels after a review-round condition narrowing. On the persisted path
the binder binds raw storage (uint64/T_enum), which base already
evaluates correctly - so the r8 round also removed an over-broad feature
classification that refused native sessions access to SET generated
expressions base serves.
- **#30930 (included)** BIT value literals `b'1'`/`b'0'` reached the
raw-byte text truth paths instead of their numeric payload in logical
operators, NOT/XOR, IF/CASE and prepared execution. BIT columns stay
with #30922 by acceptance checklist.
- **#30932 (included)** `iffCheck`/`caseCheck` excluded T_json
conditions and the table-path CASE evaluator assumed a BOOL condition
vector (panic on a JSON vector); the strict `jsonScalarToBool` cast path
was also applied inside IF/CASE.

Fix (approved design revision 9, committed at
docs/design/20261027-implicit-boolean-semantics-enum-set-bit-json.md,
content hash
dd7f1b0a57e9e4e486ca21e039f3d19fc850c6b78d171b57c286ba38a80984d5)
- Stored-payload truth for ENUM ordinals/SET bitmasks across IF, CASE
WHEN, predicates and logical operators, via identity-based recovery
(direct storage, hidden grouped slot, reversible-label decode) that
fails closed with a typed error for ambiguous declarations; every
boundary keeps exact grouped identity (D6/D10) and explicit CAST ... AS
BOOL consumes storage on every grouping/DISTINCT/derived boundary.
- One mode gate (D11): MySQL-mode statements evaluate the corrected
contracts; MATRIXONE_NATIVE statements keep byte-identical base behavior
on every boolean surface, incl. DML assignment casts and the native
joins of logservice/persisted write paths.
- BIT value literals use the numeric payload in MySQL-mode boolean
contexts; DML assignments keep base's raw-payload rejection in native
mode.
- JSON scalar conditions evaluate in-domain with MySQL conditional
numeric coercion; JSON null selects ELSE and stays distinct from SQL
NULL; strict JSON->BOOL cast is preserved outside IF/CASE;
prepared/binary execution is covered, and the persisted T_json
generated-column round-trip carries the same-version cross-mode
consumption gate (tjx): MySQL-mode sessions serve it, native-mode
sessions keep base's typed refusal.
- Remote/persisted compatibility (design revision 9): under the
repository's shutdown-only upgrade contract every in-cluster peer runs
the same binary, so the corrected contracts ship with NO per-feature
protocol version, no `MORPCLatestVersion` bump and no version gate; the
provisional MORPCVersion135 fence and its remote/persisted gate wiring
from design revisions 2-8 are removed. The shared
`JSONBooleanConditionContracts` walk has exactly one consumer, the
same-version cross-mode consumption gate for persisted T_json conditions
and ENUM storage-truth expressions
(`RequireMySQLConditionalBooleanConsumption`); SET storage conditions
are exempt (revision 8 / review finding F8, retained) because their
numeric executors are unchanged - native sessions keep base access to
SET persisted/generated expressions across authoring, SELECT, INSERT and
UPDATE, and no base-supported catalog definition is native-inaccessible.

Issue -> test proof (all commands run in the isolated validation
environment of the agent run; receipts preserved in the run logs)
- **#30931**:
`test/distributed/cases/dtype/issue_30931_enum_set_bool_truthiness.test`
and `issue_30931_consolidated_boolean_semantics.test` (230 statements
incl. the five-row truth table `IF/S+0` values, `WHERE e` -> 1,2,4,5 and
`WHERE s` -> 1,2,5, logical operators, CAST zones, grouping/DISTINCT
boundaries, tiered zone cells, the native/MySQL DML pairs, the SET
numeric-IN restores and the 29-statement SET persisted section).
Two-binary receipts: fixed binary 259/259 across the two cases
(consolidated 230/230 + enum_set 29/29, zero corruption hits); pristine
base binary 153/259 with exactly the pre-fix contract-cell failures and
every r8 SET persisted statement green (base-compatible parity). Focused
UT: `go test ./pkg/sql/plan -run
'TestIfConditionBindsEnumSetStorage|TestWherePredicateCastsEnumSetStorage|TestLogicalOperatorsAndCaseCastEnumSetStorage|TestNumericSetInListRecoversStorageAcrossBoundaries|TestExplicitBoolCastBindsGroupedStorage|TestCrossBlockExplicitBoolCastFailsClosed|TestBooleanConditionContractDetectionOnBoundExpressions|TestSetStorageConditionsExemptFromBooleanContracts|TestCrossModeConsumptionGateRequiresMySQLMode'`
- red on the pre-fix tree, green after (native-mode and zone controls
included).
- **#30930**: BIT-literal cells inside the consolidated case - `b'1' AND
1`, `b'0' AND 1`, `NOT b'1'`, XOR, `CASE WHEN b'1'`, ordinary and
server-prepared execution, and native-mode DML assignment rejections
with alive checks - green on the fixed binary and red on base in the
same two-binary cycles; Connector/J battery 25/25 PASS lines incl.
prepared reexecute/rebind and connection-usability-after-error.
- **#30932**: seven-row JSON IF/CASE reference vectors (0,1,1,0,1,0,0
with JSON null distinct from SQL NULL), prepared JSON cells and the
`tjx` persisted generated-column round-trip (catalog authoring,
INSERT/UPDATE recompute, SELECT reread, native typed refusals with alive
checks and no rows written, MySQL retry committing) - green on the fixed
binary, red on base in the same cycles.

Test commands (validation ladder actually executed)
- `go test ./pkg/sql/plan` full package (ok; repeated each revision
round), `make build` green each round.
- mo-tester pair on the two frozen cases: `bash run.sh -p
test/distributed/cases/dtype -m run -t 1 -r 100 -i
issue_30931_consolidated_boolean_semantics,issue_30931_enum_set_bool_truthiness`
against the fixed binary and against the pristine base binary (same lock
files, second frozen result) - fixed 259/259, base 153/259 with every
new r8 statement green, failure population identical to the previous
round (sorted diff empty).
- Connector/J server-prepared battery incl. `enumset_where_e` as
ServerPreparedStatement, rebinds, `json_conditions`,
`connection_usable_after_error`, `source_rows_unchanged`: 25/25 PASS.
- Final self-check pre-commit: gofmt + `go vet` + `golangci-lint
--new-from-rev` over all changed packages (this run).

Residual risks
- Zone-3 fail-closure is deliberate: ambiguous
empty-label/duplicate-label declarations reject cross-block boolean/CAST
recovery with a typed error instead of guessing (MySQL keeps separate
groups; the loud error is the safe choice).
- Native mode is intentionally the pre-change surface: it keeps base's
text-truth quirks (including the historical BIT-payload byte in the
native DML error) so upgrades stay byte-compatible; the corrected
semantics are the MySQL-mode default.
- Rollout follows the repository's shutdown-only upgrade contract
(design revision 9): releases restart every in-cluster peer onto the
same binary, so the corrected contracts carry no per-feature protocol
version and raise no HAKeeper floor; mixed-version execution inside one
cluster is an unsupported deployment mode, not a condition this PR
fences. The one retained hazards surface is same-version cross-mode:
native-mode sessions refuse persisted ENUM/JSON contract definitions
through the consumption gate.
- BIT columns remain out of scope (tracked by #30922), and JSON
conditional semantics outside IF/CASE keep the strict pre-change cast.
Broader CI suites (full distributed BVT, frontend/disttae) remain for
CI; the focused batteries and the two frozen cases carry the
reproduction-and-repair proof.

Rebase receipt (2026-10-28, conflict resolution)
- main advanced to f847803 and minted MORPCVersion132-134 in the same
const-block tail this PR claims 135 in, so Mergify's auto-update failed
to merge and the PR went CONFLICTING. Resolution: rebased onto
f847803; pkg/defines/const.go keeps main's ladder verbatim (132
decimal float rounding, 133 typed JSON MIN/MAX, 134 ordered ODKU
baseline) and applies only this PR's semantic delta: MORPCVersion135 +
MORPCLatestVersion = MORPCVersion135 (net +2/-1 vs main) - historical:
superseded by design revision 9 below, which removed the mint so
pkg/defines/const.go is byte-equal to main again. The provisional
whole-block realignment (and its anticipation comment) was dropped so
the file carries no formatting churn; every protocol gate and constant
is byte-equal to the reviewed design. All other overlapping files
(plan/colexec/compile/pb-plan protocol surfaces) auto-merged and both
sides' feature floors (132/133/134 from main + 135 from this PR) coexist
and compose.
- Post-rebase validation on the merged tree: full-package UT green for
pkg/sql/plan (ok 48.089s), pkg/sql/plan/function (ok 15.672s),
pkg/pb/plan + pkg/defines, plus targeted green for the PR batteries in
pkg/sql/colexec/colexec group, pkg/sql/compile (PR boolean-condition
contracts + main's Float/JSONMinMax/ODKU/LASTInsertID protocol neighbors
incl. TestProtocol132FloatComposesWithJSON133AndODKU134), pkg/cnservice
and pkg/hakeeper view-metadata/floor tests; `make build` green (binary
stamped 67d17dd). BVT pair re-run on the rebased binary: genRS
regeneration of the consolidated case is byte-identical to the committed
frozen .result (SHA256
7280b83da7c7f8f76c5a06336bb8c7bbcbd0990b10a5c221291a3a4f3ef8df65), both
frozen cases 259/259 at 100% (230/230 + 29/29, zero corruption hits),
and main's merged behavior introduces no drift in any of the 230
expectation cells. Connector/J server-prepared battery: 25/25 PASS incl.
rebinds, json conditions, connection_usable_after_error,
source_rows_unchanged. Owned validation services for both runs shut down
cleanly with all 27xxx listeners released.
- The pristine-base red pairing (153/259 with the pre-fix failure
population) remains valid from the pre-rebase round: the frozen cases,
expected results, and the defect's pre-fix refusal receipts are
unchanged by the rebase, and the rebased fixed binary reproduces the
identical green population, so the red/green discrimination is carried
by the same paired evidence.
SCA receipt (2026-10-28, CI run 40629398512 attempt 1, job "Matrixone CI
execution / SCA Test on Linux/arm64")
- The SCA job failed at the license-header gate before any analyzer ran:
license-eye v0.4.0's full check (full mode forced by an infra-side
config-pin mismatch; scope-only effect) reported exactly one invalid
file in CI's 73758-file tree -
`pkg/sql/colexec/evaluate_case_json_bool_test.go`, added by this PR
without the Apache-2.0 Matrix Origin header. The other 33 PR-changed .go
files were valid, so the gate failure is fully attributable to that
file.
- Fix (follow-up commit on this branch): prepend the canonical 14-line
header, byte-identical to this PR's other new files. Comment-only diff,
zero behavior change: gofmt-clean, and the two focused UTs in the file
re-run green on the fixed tree.
- Exact-mode local replay of the stages that attempt never reached:
license-eye header check on the fixed tree now reports 0 invalid files
(dep check clean too), and `make static-check-selected` over every
PR-owned package reproduces CI's passing SCA baseline: the pinned molint
recipe prints the identical pre-existing finding set seen in the green
run of merged PR #31434 (run 40610550148) with zero new diagnostics from
this PR, and golangci-lint v2.14.0 (the pinned recipe version) reports 0
issues.

Rebase receipt 2 (2026-10-28, conflict resolution onto e9dc8c4)
- main advanced again (df8bfd6 -> e9dc8c4): #31088 integer add/mul
widening, #31476 MATCH-as-condition row flag, #31506 python-sdk
validation artifacts removal, and #30316 MySQL approximate-numeric text
notation (FLOAT/DOUBLE scalar and JSON number printing, historical
catalog DOUBLE->string width-32 repair). GitHub reported this PR
CONFLICTING at head c209aee (mergeStateStatus DIRTY).
- Resolution: rebased both commits onto e9dc8c4 (new head adc62e8;
force-with-lease push, remote prerequisite exactly c209aee). The
single textual conflict was pkg/sql/plan/function/function.go, where
#30316 added `check = legacyFloatStringCheck(ctx, check, args)`
immediately before `switch check.status` - the same spot this PR added
the two D11 gates (native-mode IFF/CASE legacy condition admission,
ENUM->BOOL cast-pair gate). Semantic resolution keeps both, in main's
order: the D11 gates first, then main's legacyFloatStringCheck as the
final pre-switch override. In MySQL-contract mode the gates are inert
and binding is byte-identical to main; in native mode the gates restore
pre-contract admission first and the catalog-repair float-width
narrowing (LegacyFloatStringBounds; it only adjusts float64->varchar(34)
cast widths under succeedWithCast) then applies exactly as on main.
range-diff confirms the replay is otherwise hunk-identical and the PR
diff/file set is unchanged versus the previous head.
- All other overlapping files (base_binder.go, bind_context.go,
func_cast.go, query_builder.go, types.go, utils.go - touched upstream by
#30316/#31088) auto-merged; the merged hunks (IFNULL common-value
contract refactor, legacy float-string bound propagation in
ddlExpressionContext, integer-precision metadata) were audited and have
no interaction with the boolean-contract surfaces.
pkg/pb/plan/string_literal_form.go is hand-maintained support code (the
plan_string_literal_form postprocess only patches plan.pb.go/api.pb.go),
so the regenerated pkg/pb/plan/plan.pb.go upstream carries no
regeneration drift for this PR. BVT expectation sensitivity: the two
frozen issue-30931 cases touch no FLOAT/DOUBLE/DECIMAL surface and their
JSON cells print only strings and integers ("0.5", "1e2", {"x": 1}, [1,
2], true, null), so #30316's numeric-notation change cannot shift any of
the 230+29 expectation cells; the 259/259 fixed-binary receipts from the
merged-tree round remain the contract evidence and CI re-runs the full
BVT pair.
- Post-rebase validation on the rebased tree (all commands with the
repository CGO environment; logs preserved under the loop artifacts for
issue-30931/rebase2-evidence/): `make build` green (exit=0, mo-service
binary stamped CommitID adc62e8); `go test ./pkg/sql/plan/function`
ok 84.022s (full package - upstream's func_cast_test.go plus this PR's
func_cast_enum_bool_test/operatorSet_test additions); `go test
./pkg/sql/plan` ok 375.972s (full package - this PR's boolean-contract
batteries plus main's float_string_*/integer_precision/numeric_context
suites, all green on the merged semantics); targeted batteries green:
pkg/sql/colexec TestEvalCaseJsonCondition* ok 3.894s,
pkg/sql/colexec/group
TestGroupJointGroupingFlagsPreserveStorageTruthOnActiveArms ok 2.204s,
pkg/sql/compile TestBooleanConditionContract* ok 3.969s, pkg/cnservice
TestCNViewMetadataSameGenerationFutureFloorPoisonsWithoutRevocation ok
2.850s, pkg/hakeeper
TestPersistedFloorExpiryReleasesWithoutShutdownEvidence ok 1.325s, and
pkg/defines + pkg/pb/plan ok (0.856s/2.592s, run right after the rebase
with the equivalent plain environment). All three issue proofs (ENUM/SET
IF/WHERE/logic recovery, BIT-literal payloads, JSON IF/CASE in-domain
evaluation) are exercised inside those packages on the new base; every
step exit=0.


CI-alignment receipt (2026-10-29, compose-pessimistic BVT failure in run
40665475705, job 122744108573)
- The multi-CN e2e BVT job ran all 662 assigned scripts and failed only
dtype/set.sql rows 51/60/69: the three `group by ... count(*)` queries
over the `SET('', 'a')` and `SET('z', '', 'a')` fixtures carried
pre-contract expectations that merged the zero bitmap with the
empty-label member into one display group. Under this PR's D1 composite
(display, storage) group key those rows are separate groups that both
display `''` exactly like MySQL (recorded MySQL 8.3.0 reference; the
analogous fixture documents MySQL duplicate-key 1062 in
mysql_compat_enum_set_numeric.result), so the buried rows were stale
relative to the reviewed contract.
- Fix: commit 0d022fc "test(dtype): align set.sql grouped empty-label
SET expectations with D1 contract" - the three grouped count rows in
test/distributed/cases/dtype/set.result (merged ('',2) group becomes two
('',1) groups; group output stays the display label) and a rewritten
stale comment in test/distributed/cases/dtype/set.sql (GROUP BY keys the
stored bitmap; DISTINCT keeps one row per display label; grouped ORDER
BY sorts by the canonical bitmap of the surviving display).
- Verified locally on the head binary (BuildTime 1793166448, CommitID
adc62e8) with CI-identical mo-tester flags (run.sh -n -g -o, dtype
case root): pre-change red set.sql 84/87 failing exactly rows 51/60/69
with the same data diff CI reported; post-change green 314/314
statements 100% (set.sql 87/87, issue_28687 17/17, issue_30538 74/74,
issue_30931_enum_set_bool_truthiness 29/29,
mysql_compat_enum_set_numeric 107/107); wider neighbor battery 934/934
at 100% (binary_string_function_semantics 157, enum_1 88,
enum_index_update 107, issue_30931_consolidated_boolean_semantics 230,
mysql_compat_type_conversion 25 plus the repeated four enum_set files).
Red/green detail and command/status receipts:
/private/tmp/issue-30931-run/tests/ci-set-red-run2.log,
ci-set-green-run.log, ci-set-final-cycle.log (mo-tester exit 0, SUCCESS
RATE 100%).
- Note on one nuance: for `GROUP BY x ORDER BY x` over an empty-label
declaration the corrected rows cluster the equal-display groups together
(the #29177 canonical-display order key is intentionally preserved)
rather than interleaving members by raw storage value as MySQL would;
the grouped truth contract itself is unaffected and the
same-block/oracle batteries pin it. CI re-runs the full BVT population
on the new head.
- Delivery: pushed to the PR head branch as plain fast-forward
adc62e8 -> 0d022fc (this PR is cross-repository with its head
branch in the gouhongshen/matrixone fork; an initial push aimed at
upstream origin was refused by the repository-wide "not-create-branch"
ruleset 19657232, which restricts branch creation there for
non-maintainers). Fresh CI ran to completion on the new head (MatrixOne
ALL CI run 40799186983, completed 2026-10-29T02:38:13Z, conclusion:
success): 13 successful, 16 skipped, 0 failing, 0 pending - green across
UT on Ubuntu/x86, UT Coverage, SCA on Linux/arm64, multi-CN e2e BVT
(compose pessimistic and proxy modes) and the required `CI Required`
gate, confirming the set.sql alignment on the CI population.



Design revision 9 receipt (2026-10-30, review-driven fence removal)
- The 2026-10-30 mo-bot review (CHANGES_REQUESTED at 0d022fc) found
one P2 design-policy blocker: the per-feature MORPCVersion135 mint plus
remote and persisted expression version gates conflicts with the
repository's shutdown-only upgrade contract
(.agents/skills/mo-dev/references/upgrade-compatibility.md:13-40 - peers
inside one cluster always run the same binary; do not mint per-feature
versions, bump MORPCLatestVersion for a feature, gate on capability
checks, or extend existing gates for new features); the review
explicitly supported the SET expectation corrections. The finding was
verified anchor by anchor and answered at
#31492 (comment).
- The design was revised BEFORE implementation per
feature-design-review.md and independently PASSed with zero findings:
revision 9, committed at
docs/design/20261027-implicit-boolean-semantics-enum-set-bit-json.md,
content hash
dd7f1b0a57e9e4e486ca21e039f3d19fc850c6b78d171b57c286ba38a80984d5 -
section 7 rewritten to the same-binary remote/persisted contract,
section 8 rejects the fence alternative, section 9 removes the fence
batteries, and acceptance criterion (7) pins "no version minted,
MORPCVersion134 stays MORPCLatestVersion".
- Repair commit a811f13 "fix(plan): remove the per-feature MORPC gate
for implicit boolean contracts" implements deviation items 6-9:
MORPCVersion135 unminted and MORPCLatestVersion = MORPCVersion134
restored (pkg/defines/const.go is byte-equal to main again); the four
gate wires removed - the remoterun encode floor raise + below-135
delivery refusal, the remoteExpressionProtocolVersion requirement, the
remote-destination version tuple, and the persisted feature->version
table row (the parameterized helper is inlined back into
RequiredPersistedExpressionProtocolVersion); the walk-side comments
reworded to the mode-gate purpose. Every pre-existing gate row for
features 104-134 stays untouched, and the share-walk flag
JSONBooleanConditionContracts keeps exactly one consumer: the
same-version cross-mode consumption gate
RequireMySQLConditionalBooleanConsumption with the F8 SET exemption.
- Fence-only tests deleted:
pkg/sql/compile/boolean_condition_contracts_protocol_test.go
(TestBooleanConditionContractPlacementEncodeAndRefusal,
TestBooleanConditionContractStreamConfirmationCoversGateVersion,
TestBooleanConditionContractPersistedGatesOnBoundExpressions and the
compile-side version-floor detection test),
pkg/hakeeper/view_metadata_boolean_contracts_test.go
(TestPersistedFloorExpiryReleasesWithoutShutdownEvidence) and
pkg/cnservice/view_metadata_boolean_contracts_test.go
(TestCNViewMetadataSameGenerationFutureFloorPoisonsWithoutRevocation) in
full, plus TestRequiredPersistedBooleanConditionContractsFloor,
TestPersistedBooleanContractsPassThroughReaderLackingDetector and
TestPersistedBooleanContractsGateSimulations in
persisted_ip_boolean_contracts_test.go and
TestGeneratedColumnAssignmentCastRaisesPersistedFloor in
boolean_contracts_cross_mode_test.go. Retained green:
TestSetStorageConditionsExemptFromBooleanContracts verbatim, the
native-mode/cross-mode/semantic batteries, and the new plan-side
TestBooleanConditionContractDetectionOnBoundExpressions pinning the
feature walk over real bound ENUM/JSON expressions with
RequiredPersistedExpressionProtocolVersion = 0 and numeric negative
controls - the executable record that the feature adds no row to the
durable feature->version table.
- Post-repair focused validation (repository CGo environment; logs
preserved in the run artifacts for issue-30931): changed-closure go
build green; go vet over pkg/defines, pkg/pb/plan, pkg/hakeeper,
pkg/cnservice, pkg/sql/plan and pkg/sql/compile exit 0 (the
hakeeper/cnservice test sets still compile after the fence-file
deletions); gofmt clean over all changed files; the 22-test plan
retention battery green (22 PASS / 0 FAIL: detection + SET exemption +
cross-mode consumption gate + native-mode parity + the ENUM/SET/BIT
semantic batteries); go test -run Persist ./pkg/sql/plan/ green (86 PASS
/ 0 FAIL); full pkg/pb/plan package ok; pkg/sql/compile
TestViewMetadataSender*|TestJSONStringConsumer* ok - main's pre-existing
protocol gates for other features compose unchanged.
- Semantics unchanged: the repair deletes gating only, so every recorded
expected value of all three members keeps standing and the paired
two-binary BVT receipts (fixed 259/259 vs pristine base 153/259 on the
two frozen issue_30931 dtype cases) remain valid; CI re-runs the full
population at the new head a811f13.

---------

Co-authored-by: gouhongshen <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

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

kind/bug Something isn't working size/L Denotes a PR that changes [500,999] lines

Projects

None yet

2 participants