ALTER TABLE ... ALTER COLUMN ... SET NOT NULL fails on a text column that has a secondary index, with a MySQL-dialect error:
CREATE TABLE t1 (pk integer PRIMARY KEY, value text);
CREATE INDEX t1_value_idx ON t1 (value);
INSERT INTO t1 VALUES (1, 'one');
ALTER TABLE t1 ALTER COLUMN value SET NOT NULL;
ERROR: blob/text column 'value' used in key specification without a key length
The statement works when the column has no secondary index. The error comes from GMS's ValidateModifyColumn, which applies MySQL's key-prefix-length rule to text/blob columns on any column modification; Postgres text columns are indexable without a key length, so the rule shouldn't apply to Doltgres.
ALTER TABLE ... ALTER COLUMN ... SET NOT NULLfails on a text column that has a secondary index, with a MySQL-dialect error:The statement works when the column has no secondary index. The error comes from GMS's
ValidateModifyColumn, which applies MySQL's key-prefix-length rule to text/blob columns on any column modification; Postgres text columns are indexable without a key length, so the rule shouldn't apply to Doltgres.