未验证 提交 e33c23bd 编写于 作者: T tmysql 提交者: GitHub

alter table 修改字符集用convert to (#295)

convert to匹配模式优化,允许两个单词中间有多个空格
上级 1972d89e
......@@ -2793,7 +2793,7 @@ func (q *Query4Audit) RuleAlterCharset() Rule {
if option.Tp == tidb.TableOptionCharset ||
option.Tp == tidb.TableOptionCollate {
//增加CONVERT TO的判断
convertReg, _ := regexp.Compile("convert to")
convertReg, _ := regexp.Compile("convert\\b\\s+to")
if convertReg.Match([]byte(strings.ToLower(q.Query))) {
break
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册