Skip to content

fix(plan): support enum and prefix text indexes (cherry-pick #24809) - #25042

Merged
mergify[bot] merged 1 commit into
matrixorigin:mainfrom
ck89119:issue-24740-cherry-pick-main
Jun 18, 2026
Merged

mergify[bot] merged 1 commit into
matrixorigin:mainfrom
ck89119:issue-24740-cherry-pick-main

Conversation

@ck89119

@ck89119 ck89119 commented Jun 17, 2026

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 #24740
Fixes #24729

What this PR does / why we need it:

  • Allows ENUM columns in secondary, unique, and composite indexes while keeping ENUM primary keys rejected.
  • Allows TEXT/BLOB prefix indexes and keeps plain TEXT/BLOB indexes rejected.
  • Persists index prefix lengths in index metadata and applies prefix expressions during index backfill, insert, unique dedup, and lock-key generation.
  • Adds focused unit coverage and BVT cases for ENUM indexes and TEXT/BLOB prefix indexes.

Validation:

  • go test ./pkg/sql/plan -run 'TestBuildIndexAllowsEnumAndTextBlobPrefix|TestBuildIndexRejectsTextBlobPlainIndex' -count=1
  • go test ./pkg/sql/compile -run 'TestGenInsertIndexTableSql_UsesPrefixExpression|TestBuildCreateUniqueIndexDuplicateCheckSQL' -count=1
  • go test ./pkg/sql/colexec/preinsertunique ./pkg/sql/colexec/preinsertsecondaryindex -count=1
  • ./run.sh -p /Users/LoveYY/Develop/matrixorigin/matrixone/.worktrees/issue-24740/test/distributed/cases/ddl/create_index.sql -g -n
  • ./run.sh -p /Users/LoveYY/Develop/matrixorigin/matrixone/.worktrees/issue-24740/test/distributed/cases/dtype/enum.sql -g -n
  • git diff --check
  • make
  • make static-check

@ck89119
ck89119 requested a review from a user June 17, 2026 12:49
@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 →

- Allows ENUM columns in secondary, unique, and composite indexes while keeping ENUM primary keys rejected.
- Allows TEXT/BLOB prefix indexes and keeps plain TEXT/BLOB indexes rejected.
- Persists index prefix lengths in index metadata and applies prefix expressions during index backfill, insert, unique dedup, and lock-key generation.
- Adds focused unit coverage and BVT cases for ENUM indexes and TEXT/BLOB prefix indexes.

Validation:

- `go test ./pkg/sql/plan -run 'TestBuildIndexAllowsEnumAndTextBlobPrefix|TestBuildIndexRejectsTextBlobPlainIndex' -count=1`
- `go test ./pkg/sql/compile -run 'TestGenInsertIndexTableSql_UsesPrefixExpression|TestBuildCreateUniqueIndexDuplicateCheckSQL' -count=1`
- `go test ./pkg/sql/colexec/preinsertunique ./pkg/sql/colexec/preinsertsecondaryindex -count=1`
- `./run.sh -p /Users/LoveYY/Develop/matrixorigin/matrixone/.worktrees/issue-24740/test/distributed/cases/ddl/create_index.sql -g -n`
- `./run.sh -p /Users/LoveYY/Develop/matrixorigin/matrixone/.worktrees/issue-24740/test/distributed/cases/dtype/enum.sql -g -n`
- `git diff --check`
- `make`
- `make static-check`

Approved by: @heni02, @XuPeng-SH, @aunjgr
@mergify

mergify Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-06-18 15:08 UTC · Rule: main
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged — 2026-06-18 15:08 UTC · at 8bd8d0c79cd1f0f42106de965b7bdef2c760f6b0 · squash

This pull request spent 18 seconds in the queue, including 3 seconds running CI.

Required conditions to merge
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-decision = APPROVED [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-neutral = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-skipped = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
  • 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 / SCA Test on Ubuntu/x86
    • check-neutral = Matrixone CI / SCA Test on Ubuntu/x86
    • check-skipped = Matrixone CI / SCA Test on Ubuntu/x86
  • 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 Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-neutral = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-skipped = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage

@mergify
mergify Bot merged commit f7eb388 into matrixorigin:main Jun 18, 2026
23 of 24 checks passed
@mergify mergify Bot removed the queued label Jun 18, 2026
@ck89119
ck89119 deleted the issue-24740-cherry-pick-main branch June 19, 2026 07:57
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…igin#24809) (matrixorigin#25042)

- Allows ENUM columns in secondary, unique, and composite indexes while keeping ENUM primary keys rejected.
- Allows TEXT/BLOB prefix indexes and keeps plain TEXT/BLOB indexes rejected.
- Persists index prefix lengths in index metadata and applies prefix expressions during index backfill, insert, unique dedup, and lock-key generation.
- Adds focused unit coverage and BVT cases for ENUM indexes and TEXT/BLOB prefix indexes.

Validation:

- `go test ./pkg/sql/plan -run 'TestBuildIndexAllowsEnumAndTextBlobPrefix|TestBuildIndexRejectsTextBlobPlainIndex' -count=1`
- `go test ./pkg/sql/compile -run 'TestGenInsertIndexTableSql_UsesPrefixExpression|TestBuildCreateUniqueIndexDuplicateCheckSQL' -count=1`
- `go test ./pkg/sql/colexec/preinsertunique ./pkg/sql/colexec/preinsertsecondaryindex -count=1`
- `./run.sh -p /Users/LoveYY/Develop/matrixorigin/matrixone/.worktrees/issue-24740/test/distributed/cases/ddl/create_index.sql -g -n`
- `./run.sh -p /Users/LoveYY/Develop/matrixorigin/matrixone/.worktrees/issue-24740/test/distributed/cases/dtype/enum.sql -g -n`
- `git diff --check`
- `make`
- `make static-check`

Approved by: @XuPeng-SH, @heni02, @aunjgr
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…igin#24809) (matrixorigin#25042)

- Allows ENUM columns in secondary, unique, and composite indexes while keeping ENUM primary keys rejected.
- Allows TEXT/BLOB prefix indexes and keeps plain TEXT/BLOB indexes rejected.
- Persists index prefix lengths in index metadata and applies prefix expressions during index backfill, insert, unique dedup, and lock-key generation.
- Adds focused unit coverage and BVT cases for ENUM indexes and TEXT/BLOB prefix indexes.

Validation:

- `go test ./pkg/sql/plan -run 'TestBuildIndexAllowsEnumAndTextBlobPrefix|TestBuildIndexRejectsTextBlobPlainIndex' -count=1`
- `go test ./pkg/sql/compile -run 'TestGenInsertIndexTableSql_UsesPrefixExpression|TestBuildCreateUniqueIndexDuplicateCheckSQL' -count=1`
- `go test ./pkg/sql/colexec/preinsertunique ./pkg/sql/colexec/preinsertsecondaryindex -count=1`
- `./run.sh -p /Users/LoveYY/Develop/matrixorigin/matrixone/.worktrees/issue-24740/test/distributed/cases/ddl/create_index.sql -g -n`
- `./run.sh -p /Users/LoveYY/Develop/matrixorigin/matrixone/.worktrees/issue-24740/test/distributed/cases/dtype/enum.sql -g -n`
- `git diff --check`
- `make`
- `make static-check`

Approved by: @XuPeng-SH, @heni02, @aunjgr
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…igin#24809) (matrixorigin#25042)

- Allows ENUM columns in secondary, unique, and composite indexes while keeping ENUM primary keys rejected.
- Allows TEXT/BLOB prefix indexes and keeps plain TEXT/BLOB indexes rejected.
- Persists index prefix lengths in index metadata and applies prefix expressions during index backfill, insert, unique dedup, and lock-key generation.
- Adds focused unit coverage and BVT cases for ENUM indexes and TEXT/BLOB prefix indexes.

Validation:

- `go test ./pkg/sql/plan -run 'TestBuildIndexAllowsEnumAndTextBlobPrefix|TestBuildIndexRejectsTextBlobPlainIndex' -count=1`
- `go test ./pkg/sql/compile -run 'TestGenInsertIndexTableSql_UsesPrefixExpression|TestBuildCreateUniqueIndexDuplicateCheckSQL' -count=1`
- `go test ./pkg/sql/colexec/preinsertunique ./pkg/sql/colexec/preinsertsecondaryindex -count=1`
- `./run.sh -p /Users/LoveYY/Develop/matrixorigin/matrixone/.worktrees/issue-24740/test/distributed/cases/ddl/create_index.sql -g -n`
- `./run.sh -p /Users/LoveYY/Develop/matrixorigin/matrixone/.worktrees/issue-24740/test/distributed/cases/dtype/enum.sql -g -n`
- `git diff --check`
- `make`
- `make static-check`

Approved by: @XuPeng-SH, @heni02, @aunjgr

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 kind/test-ci size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

4 participants