Skip to content

fix(plan): support enum and prefix text indexes#24809

Open
ck89119 wants to merge 1 commit into
matrixorigin:4.0-devfrom
ck89119:issue-24740
Open

fix(plan): support enum and prefix text indexes#24809
ck89119 wants to merge 1 commit into
matrixorigin:4.0-devfrom
ck89119:issue-24740

Conversation

@ck89119
Copy link
Copy Markdown
Contributor

@ck89119 ck89119 commented Jun 3, 2026

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

@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 →

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/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants