Skip to content

Commit

Permalink
remove extra var
Browse files Browse the repository at this point in the history
  • Loading branch information
hasa1K committed May 7, 2024
1 parent 91bc0ca commit 2890b7c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sqle/driver/mysql/rollback.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down

0 comments on commit 2890b7c

Please sign in to comment.