fix: 执行脚SQL脚本时解析SQL失败

SQL脚本中包含use mayfly-go,应为use `mayfly-go`。
This commit is contained in:
wanli
2023-09-04 11:00:07 +08:00
parent eee6cf7b14
commit 57a5e237ae

View File

@@ -198,6 +198,10 @@ func (d *Db) ExecSqlFile(rc *req.Ctx) {
if err == io.EOF {
break
}
if err != nil {
d.MsgApp.CreateAndSend(rc.LoginAccount, ws.ErrMsg("sql脚本执行失败", fmt.Sprintf("[%s][%s] 解析SQL失败: [%s]", filename, dbInstance.Info.GetLogDesc(), err.Error())))
return
}
sql := sqlparser.String(stmt)
execReq.Sql = sql
// 需要记录执行记录