Implement "drop column with index" through dropping index before dropping column
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement
For `alter table xxx drop column xxx` statement, it will drop both the column and its index. It brings some problems (e.g. https://github.com/pingcap/tidb/issues/40192). It's also not online-enough in some cases: if a `NOT NULL UNIQUE` column is in write-only mode, the user cannot actually write any data into the table, because the default value of this column is always inserted and checked as duplicated... (though, sounds not like a big problem).
We could try to implement "drop column with index" in multiple steps: drop the index first and then drop the column. It will fix this problem. It'll also make the routine of dropping column more unified with other implementations.
Contributor guide
Assessment
This issue has not been assessed yet.