From 874a9a051bd674626c1d061f2a97613514a24d6e Mon Sep 17 00:00:00 2001 From: bianyucheng Date: Tue, 7 May 2024 13:53:43 +0800 Subject: [PATCH] remove extra var --- sqle/driver/mysql/rollback.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sqle/driver/mysql/rollback.go b/sqle/driver/mysql/rollback.go index 7be00dde31..63a1b2b4b8 100644 --- a/sqle/driver/mysql/rollback.go +++ b/sqle/driver/mysql/rollback.go @@ -597,15 +597,13 @@ func (i *MysqlDriverImpl) generateUpdateRollbackSql(stmt *ast.UpdateStmt) (strin if err != nil { return "", "", err } - columnsName := []string{} rollbackSql := "" colNameDefMap := make(map[string]*ast.ColumnDef) for _, col := range createTableStmt.Cols { - columnsName = append(columnsName, col.Name.Name.String()) colNameDefMap[col.Name.Name.String()] = col } for _, record := range records { - if len(record) != len(columnsName) { + if len(record) != len(colNameDefMap) { return "", "", nil } where := []string{}