技术饭

mysql8.0.19中在navicat客户端中int、bigint等类型设置长度保存后为0

copylian    0 评论    15787 浏览    2020.11.11

今天在将开发库(mysql版本号:5.7.24)的表结构和正式库(mysql版本号:8.0.19)表结构做比对的时候,发现大量表中字段不一致,初以为是切换到正式库时执行SQL报错了,后,手工修改表字段长度还是不行。

在navicat中修改表中bigint字段长度如下:

20200601154058240.png

在linux中登录mysql,执行表修改语句如下:

mysql> ALTER TABLE `mall_app_notice`  MODIFY COLUMN `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键' FIRST;

发现有告警信息,接下来执行:

mysql> show warnings;

20200601153818334.png

原因分析:

根据告警的提示信息指出:integer的宽度显示将在未来版本被移除

官网相关资料:

MySQL Server 8.0.17 deprecated the display width for the TINYINT, SMALLINT, MEDIUMINT, INT, and BIGINT data types when the ZEROFILL modifier is not used, and MySQL Server 8.0.19 has removed the display width for those data types from results of SHOW CREATE TABLE, SHOW CREATE FUNCTION, and queries on INFORMATION_SCHEMA.COLUMNS, INFORMATION_SCHEMA.ROUTINES, and INFORMATION_SCHEMA.PARAMETERS (except for the display width for signed TINYINT(1)). This patch adjusts Connector/J to those recent changes of MySQL Server and, as a result, DatabaseMetaData, ParameterMetaData, and ResultSetMetaData now report identical results for all the above-mentioned integer types and also for the FLOAT and DOUBLE data types. (Bug #30477722)

根据官网资料可知:从8.0.17版本开始,TINYINT, SMALLINT, MEDIUMINT, INT, and BIGINT类型的显示宽度将失效。

只袄早~~~
感谢你的支持,我会继续努力!
扫码打赏,感谢您的支持!

文明上网理性发言!

  • 还没有评论,沙发等你来抢