Skip to content

[Bug]: TEXT column cannot be in any index, including prefix index (v3.0.11 & 4.0-dev) #24740

Closed

Description

@dengn

Summary

A TEXT column cannot be placed in an index — neither a prefix index (col(N)) nor a plain index. Both fail with not supported: TEXT column 'x' cannot be in index. This is the same "column-type cannot be in index" family as the ENUM restriction in #24729.

Steps to Reproduce

-- prefix index:
CREATE TABLE tx (id INT PRIMARY KEY, t TEXT, INDEX tx_t (t(100)));
-- ERROR 20105 (HY000): not supported: TEXT column 't' cannot be in index

-- plain index:
CREATE TABLE ty (id INT PRIMARY KEY, t TEXT, INDEX ty_t (t));
-- ERROR 20105 (HY000): not supported: TEXT column 't' cannot be in index

Prisma impact

Low — Prisma uses VARCHAR(191) for indexed String fields by default; only a model that places an @@index/@@unique on an @db.Text/@db.LongText field is affected. (Prefix indexes on TEXT/BLOB are the standard MySQL way to index large columns.)

Expected Behavior

MySQL allows a prefix index on TEXT/BLOB columns, e.g. INDEX (col(100)).

Related: #24729 (ENUM column cannot be in index).


Found during Prisma ORM (v5.22) / MySQL-compat testing; reproduced on prod 8.0.30-MatrixOne-v3.0.11 and nightly-0bfda604.

Activity

  1. added
    kind/bug
    on May 31, 2026
  2. added
    severity/s0
    on Jun 2, 2026
  3. added theissue type on Jun 2, 2026
  4. added this to the MO-202606 milestone on Jun 2, 2026
  5. assigned and unassigned on Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugseverity/s0

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions