Skip to content

fix: support enum and year in serial_extract - #26943

Merged
mergify[bot] merged 2 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/issue-26873-enum-year-serial-extract
Aug 11, 2026
Merged

mergify[bot] merged 2 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/issue-26873-enum-year-serial-extract

Conversation

@VioletQwQ-0

Copy link
Copy Markdown
Collaborator

What type of PR is this?

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

Which issue(s) this PR fixes:

issue #26873

What this PR does / why we need it:

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.

Validation:

  • TestSerialExtractEnumAndYear
  • pkg/sql/plan/function full test package
  • TestIssue26873BinaryPreparedEnumAndYearCoveringIndex
  • git diff --check
  • Semantic preflight: PASS
  • BVT: N/A. The SQL BVT runner cannot issue MySQL binary prepared-statement
    packets; the embedded-cluster issue test above exercises the exact public
    protocol boundary.

QA Decision

  • Required: yes
  • Reason: user-visible MySQL binary prepared-statement behavior with covering
    secondary indexes.
  • Automated terminal coverage: pkg/tests/issues/issue_26873_test.go.
  • Remaining QA: repeat the issue reproduction through Proxy and on a multi-CN
    deployment.

@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

Choose a reason for hiding this comment

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

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.

@mergify mergify Bot added the queued label Aug 11, 2026
@mergify

mergify Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-08-11 03:55 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-08-11 05:06 UTC · at 73cbaf8a8d96e7e9f93a72704709b92e57c56d52 · squash

This pull request spent 1 hour 10 minutes 35 seconds in the queue, including 51 minutes 37 seconds running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / SCA Test on Linux/arm64
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86

@mergify
mergify Bot merged commit 8c6ada2 into matrixorigin:main Aug 11, 2026
26 of 27 checks passed
@mergify mergify Bot removed the queued label Aug 11, 2026
VioletQwQ-0 added a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
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
VioletQwQ-0 added a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
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
VioletQwQ-0 added a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
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
XuPeng-SH added a commit that referenced this pull request Nov 25, 2026
## 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.
@VioletQwQ-0
VioletQwQ-0 deleted the codex/issue-26873-enum-year-serial-extract branch December 1, 2026 03:47

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/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants