pingcap / pingcap/tidb

ddl: skip reorg for `MODIFY COLUMN` in some cases

Open
#63,595 0 comments 0 reactions 0 assignees View on GitHub
component/ddl type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement

Currently, we have a strict criterion to determine whether to do `MODIFY COLUMN` with reorg.

For example, `VARCHAR` to `CHAR` need reorg, since it may has truncation, as `VARCHAR` doesn't trim trailling space.

But in some scenarios, the reorg can be skipped. For example, if we want to modify `BIGINT` to `INT` with **strict SQL mode** (important), the reorg is redundant:
1. If there are some out-of-range values, the DDL should fail.
2. If all the values are in the range of `INT`, we don't need to rewrite the data as the encoding is not changed.

So in such cases, we can also do the modification without changing data too.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.