Clear executor transaction
This commit is contained in:
parent
9c101af74a
commit
412b15cc11
1 changed files with 9 additions and 5 deletions
|
@ -85,6 +85,7 @@ func (e *executor) execute(ctx context.Context, ast *sql.Query) {
|
|||
if e.tx != nil {
|
||||
e.tx.Cancel()
|
||||
clear(e.id)
|
||||
e.tx = nil
|
||||
}
|
||||
}()
|
||||
|
||||
|
@ -255,16 +256,19 @@ func (e *executor) operate(ctx context.Context, stm sql.Statement) (res []interf
|
|||
loc, trw = true, false
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if e.tx != nil {
|
||||
e.tx.Cancel()
|
||||
clear(e.id)
|
||||
e.tx = nil
|
||||
}
|
||||
}()
|
||||
|
||||
err = e.begin(ctx, trw)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
defer func() {
|
||||
e.tx.Cancel()
|
||||
e.tx = nil
|
||||
}()
|
||||
|
||||
}
|
||||
|
||||
// Mark the beginning of this statement so we
|
||||
|
|
Loading…
Reference in a new issue