Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复审核MySQL8.0更改列类型时报数组越界的错误问题 #694

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidzhangbj
Copy link

goInception版本:goInception-linux-v1.3.0-94-g2f06c61b95.tar.gz
mysql版本:8.0.20
mysql表结构:create table t1 (id bigint unsigned not null primary key auto_increment, c1 int not null default '0');
alter语句:alter table t1 change column c1 c1 varchar(256) not null default '';
使用goInception审核这个alter语句时报:“slice bounds out of range [:7) with capacity 3”错误,原因是同一个建表语句,mysql5.7为int(11),mysql8.0为int
mysql8.0.20
image
mysql5.7.44
image
所以在截取时对foundField.Type做判断,如果foundField.Type长度小于7位,以实际长度进行截取,如果大于等于7位,就按照7位进行截取

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant