Integer zerofill size attribute should not prevent type modification #20529
Labels
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
severity/major
sig/sql-infra
SIG: SQL Infra
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
No data loss can occur with this statement, and it does not cause any change to data storage format. The number in parentheses after an integer data type is just an advisory number used for "zerofill" in the client.
This issue can cause problems during migration if a customer exploits the equivalence between TINYINT and BOOLEAN. When a customer creates a BOOLEAN column, it's implicitly converted to TINYINT(1). Because the "arguments" to integer types are irrelevant, they may be omitted during certain operations, in which case TINYINT(1) can be converted to TINYINT(4). If a customer tries to execute an ALTER TABLE that modifies this column that was originally BOOLEAN (but is now TINYINT(4)) and treats it again as a BOOLEAN, they'll get an error.
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: