See <https://discourse.phabricator-community.org/t/wrong-column-type-everywhere-other-errors-on-fresh-db-upgrade/3872/>.
Between MySQL 8.0.11 and 8.0.20, the output of `SHOW CREATE TABLE` has changed for integer columns.
Here's example output from 8.0.11:
```name="MySQL 8.0.11"
mysql> CREATE TEMPORARY TABLE t (i INT UNSIGNED NOT NULL);
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW CREATE TABLE t;
+-------+---------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+---------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TEMPORARY TABLE `t` (
`i` int(10) unsigned NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+-------+---------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
```
Here's example output from 8.0.20:
```name="MySQL 8.0.20
mysql> CREATE TEMPORARY TABLE t (i INT UNSIGNED NOT NULL);
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW CREATE TABLE t;
+-------+-----------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-----------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TEMPORARY TABLE `t` (
`i` int unsigned NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+-------+-----------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
Note that `int(10) unsigned` is now `int unsigned` in the output.
This change likely in 8.0.19, although I haven't tested adjacent versions.
> Display width specification for integer data types was deprecated in MySQL 8.0.17, and now **statements that include data type definitions in their output no longer show the display width for integer types**, with these exceptions...
> <https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-19.html>
The 8.0.17 changelog just mentions the deprecation and doesn't appear to provide more details:
> The ZEROFILL attribute is deprecated for numeric data types, **as is the display width attribute for integer data types.**
> <https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-17.html>
This causes `bin/storage upgrade` to believe that the column type is incorrect and attempt to adjust it.
---
We don't (knowingly) rely on the integer display width feature, so the fix is likely just to parse `int(10)` and `int` as equivalent.
The one case I can think of where we //may// depend on the behavior of this feature is that `BOOL` was historically an alias for `TINYINT(1)`.