Skip to content

Commit

Permalink
executor: do not log slow query for pessimistic write conflict retry (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sre-bot authored Apr 1, 2020
1 parent 3e23cdd commit 0f94f46
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions executor/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,25 +455,20 @@ func (a *ExecStmt) handlePessimisticSelectForUpdate(ctx context.Context, e Execu
}

func (a *ExecStmt) runPessimisticSelectForUpdate(ctx context.Context, e Executor) (sqlexec.RecordSet, error) {
rs := &recordSet{
executor: e,
stmt: a,
}
defer func() {
terror.Log(rs.Close())
terror.Log(e.Close())
}()

var rows []chunk.Row
var err error
fields := rs.Fields()
req := rs.NewChunk()
req := newFirstChunk(e)
for {
err = rs.Next(ctx, req)
err = Next(ctx, e, req)
if err != nil {
// Handle 'write conflict' error.
break
}
if req.NumRows() == 0 {
fields := colNames2ResultFields(e.Schema(), a.OutputNames, a.Ctx.GetSessionVars().CurrentDB)
return &chunkRowRecordSet{rows: rows, fields: fields, e: e}, nil
}
iter := chunk.NewIterator4Chunk(req)
Expand Down

0 comments on commit 0f94f46

Please sign in to comment.