修复审核MySQL8.0更改列类型时报数组越界的错误问题#694
Open
davidzhangbj wants to merge 1 commit intohanchuanchuan:masterfrom
Open
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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
c1c1varchar(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
mysql5.7.44
所以在截取时对foundField.Type做判断,如果foundField.Type长度小于7位,以实际长度进行截取,如果大于等于7位,就按照7位进行截取