refactor: code review

This commit is contained in:
meilin.huang
2024-01-30 21:56:49 +08:00
parent 3f828cc5b0
commit ac2ceed3f9
6 changed files with 27 additions and 40 deletions

View File

@@ -211,7 +211,7 @@ func doUpdate(ctx context.Context, update *sqlparser.Update, execSqlReq *DbSqlEx
tableStr := sqlparser.String(update.TableExprs)
// 可能使用别名,故空格切割
tableName := strings.Split(tableStr, " ")[0]
if strings.Index(tableName, ".") > -1 {
if strings.Contains(tableName, ".") {
tableName = strings.Split(tableName, ".")[1]
}
where := sqlparser.String(update.Where)