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{}