You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: TEXT column cannot be in any index, including prefix index (v3.0.11 & 4.0-dev) #24740
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:CREATETABLEtx (id INTPRIMARY KEY, t TEXT, INDEX tx_t (t(100)));
-- ERROR 20105 (HY000): not supported: TEXT column 't' cannot be in index-- plain index:CREATETABLEty (id INTPRIMARY 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)).
Activity