From e33c23bd076dd724b4807059cd4db6d459f5446a Mon Sep 17 00:00:00 2001 From: tmysql <531907001@qq.com> Date: Wed, 6 Apr 2022 23:21:39 +0800 Subject: [PATCH] =?UTF-8?q?alter=20table=20=E4=BF=AE=E6=94=B9=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E9=9B=86=E7=94=A8convert=20to=20(#295)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit convert to匹配模式优化,允许两个单词中间有多个空格 --- advisor/heuristic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advisor/heuristic.go b/advisor/heuristic.go index 1d57a0f..d914427 100644 --- a/advisor/heuristic.go +++ b/advisor/heuristic.go @@ -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 { -- GitLab