pingcap/tidb

unsupported add column 'name' constraint UNIQUE KEY when altering

Open

#30,188 opened on Nov 26, 2021

View on GitHub
 (4 comments) (0 reactions) (0 assignees)Go (6,186 forks)batch import
help wantedsig/sql-infratype/enhancement

Repository metrics

Stars
 (40,090 stars)
PR merge metrics
 (Avg merge 14d 4h) (346 merged PRs in 30d)

Description

Bug Report

It works fine on MySQL but reports an error on TiDB.

1. Minimal reproduce step (Required)

create table t2(id int);
ALTER TABLE `t2` ADD COLUMN `name` varchar(255) UNIQUE;

2. What did you expect to see? (Required)

No error.

3. What did you see instead (Required)

(8200, "unsupported add column 'name' constraint UNIQUE KEY when altering 'test.t2'")

4. What is your TiDB version? (Required)

tidb_version() | Release Version: v5.1.2
Edition: Community
Git Commit Hash: dc079337ef0c9d78eec2d2acb1eb31e12117d29b
Git Branch: heads/refs/tags/v5.1.2
UTC Build Time: 2021-09-27 02:47:40
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

Contributor guide