Repository navigation
fix: support enum and year in serial_extract - #26943
mergify[bot] merged 2 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.
Deep-reviewed exact head 75511c5f5616016dd15be56c4413159d97556350 against merge-base 00cb7ef3169a6c61f358774ac5c690a405ac162d.
The enum/year dispatch is consistent with the existing tuple pack/unpack contracts: both types are already serial-supported, their packers preserve the named values, and both const-index and row-index extraction paths return the declared type. The prepared-statement regression also exercises the public binary protocol with index backfill and NULL handling.
Focused controlled-CGo tests passed for TestSerialExtractEnumAndYear and TestIssue26873BinaryPreparedEnumAndYearCoveringIndex; git diff --check passes and required CI is green. I found no blocking correctness, compatibility, lifecycle, or performance issue.
Merge Queue Status
This pull request spent 1 hour 10 minutes 35 seconds in the queue, including 51 minutes 37 seconds running CI. Required conditions to merge
|
Adds `ENUM` and `YEAR` result dispatch to `serial_extract`, using their exact named vector types (`types.Enum` and `types.MoYear`). The serial encoder and tuple decoder already preserve these named types; the extractor previously fell through to `not supported type` on a binary-prepared covering-index path. The regression coverage includes: - White-box extraction for both types through constant-index and row-index unpack paths. - A real MySQL `COM_STMT_PREPARE` / `COM_STMT_EXECUTE` test with `interpolateParams=false`, literal/index-free/backfill controls, and NULL binds. Non-goals: no planner rewrite, secondary-index encoding, or index-layout change. Approved by: @XuPeng-SH
Adds `ENUM` and `YEAR` result dispatch to `serial_extract`, using their exact named vector types (`types.Enum` and `types.MoYear`). The serial encoder and tuple decoder already preserve these named types; the extractor previously fell through to `not supported type` on a binary-prepared covering-index path. The regression coverage includes: - White-box extraction for both types through constant-index and row-index unpack paths. - A real MySQL `COM_STMT_PREPARE` / `COM_STMT_EXECUTE` test with `interpolateParams=false`, literal/index-free/backfill controls, and NULL binds. Non-goals: no planner rewrite, secondary-index encoding, or index-layout change. Approved by: @XuPeng-SH
Adds `ENUM` and `YEAR` result dispatch to `serial_extract`, using their exact named vector types (`types.Enum` and `types.MoYear`). The serial encoder and tuple decoder already preserve these named types; the extractor previously fell through to `not supported type` on a binary-prepared covering-index path. The regression coverage includes: - White-box extraction for both types through constant-index and row-index unpack paths. - A real MySQL `COM_STMT_PREPARE` / `COM_STMT_EXECUTE` test with `interpolateParams=false`, literal/index-free/backfill controls, and NULL binds. Non-goals: no planner rewrite, secondary-index encoding, or index-layout change. Approved by: @XuPeng-SH
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue #33258 ## What this PR does / why we need it: Backports the `serial_extract` ENUM/YEAR result dispatch from #26943 to `4.2-dev`, using the exact named vector types `types.Enum` and `types.MoYear`. Composite secondary-index lookups no longer fail with `20101 internal error: not supported type ENUM/YEAR` when extracting those key parts. Regression coverage includes: - Constant-index and row-index extraction for both types. - Literal and binary-prepared equality/`IN` predicates. - Forced-index and no-index controls, plus NULL binds. - Both inline indexes and indexes backfilled with `ALTER TABLE ... ADD KEY`. The backfilled ENUM path relies on the physical-key encoding from #33152, which is already merged into this PR's `4.2-dev` base. ## Validation: - `go test ./pkg/sql/plan/function -run '^TestSerialExtractEnumAndYear$' -count=1`: PASS. - Full `go test ./pkg/sql/plan/function -count=1`: PASS. - `go test ./pkg/tests/issues -run '^TestIssue33258CompositeEnumAndYearIndexLookup$' -count=1 -v`: PASS; inline and backfilled groups, including all 28 leaf cases. - `go vet ./pkg/sql/plan/function ./pkg/tests/issues`: PASS. - Independent code review found no implementation correctness issue; its prepared/backfill coverage finding was addressed in the final test. - Independent final QA built exact commit `f5a4f4e0b26a085d9f1254cd557127c56e8b3674` (binary self-reported `f5a4f4e0b2`), confirmed all 31 focused-test PASS records, and passed separate `ALTER ADD INDEX` black-box probes for ENUM, YEAR, and an INT control. Scope: no full repository suite or multi-CN run; validation used the controlled local darwin/arm64 CGo setup.
What type of PR is this?
Which issue(s) this PR fixes:
issue #26873
What this PR does / why we need it:
Adds
ENUMandYEARresult dispatch toserial_extract, using their exactnamed vector types (
types.Enumandtypes.MoYear). The serial encoder andtuple decoder already preserve these named types; the extractor previously
fell through to
not supported typeon a binary-prepared covering-index path.The regression coverage includes:
unpack paths.
COM_STMT_PREPARE/COM_STMT_EXECUTEtest withinterpolateParams=false, literal/index-free/backfill controls, and NULLbinds.
Non-goals: no planner rewrite, secondary-index encoding, or index-layout
change.
Validation:
TestSerialExtractEnumAndYearpkg/sql/plan/functionfull test packageTestIssue26873BinaryPreparedEnumAndYearCoveringIndexgit diff --checkpackets; the embedded-cluster issue test above exercises the exact public
protocol boundary.
QA Decision
secondary indexes.
pkg/tests/issues/issue_26873_test.go.deployment.