From 99f5c7e4da8e405d46d4f404a395bf3030c3593c Mon Sep 17 00:00:00 2001 From: hanchuanchuan Date: Mon, 6 Jan 2020 17:20:12 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E5=AE=8C=E5=96=84=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E5=99=A8=E4=B8=A5=E6=A0=BC=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- session/session_inception.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/session/session_inception.go b/session/session_inception.go index 834424aa..bfc32b59 100644 --- a/session/session_inception.go +++ b/session/session_inception.go @@ -439,7 +439,8 @@ func (s *session) executeInc(ctx context.Context, sql string) (recordSets []sqle if err == nil && len(stmtNodes) == 0 { tmpSQL := strings.TrimSpace(s1) // 未成功解析时,添加异常判断 - if !strings.HasPrefix(tmpSQL, "#") && + if tmpSQL != "" && + !strings.HasPrefix(tmpSQL, "#") && !strings.HasPrefix(tmpSQL, "--") && !strings.HasPrefix(tmpSQL, "/*") { err = errors.New("解析失败! 可能是解析器bug,请联系作者.")