Skip to content

Commit

Permalink
fix: release savepoint should not return connection (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
dk-lockdown committed Aug 18, 2022
1 parent 63b19cb commit 47f1059
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion pkg/executor/read_write_splitting.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ func (executor *ReadWriteSplittingExecutor) ExecutorComQuery(
if !ok {
return nil, 0, errors.New("there is no transaction")
}
defer executor.localTransactionMap.Delete(connectionID)
tx = txi.(proto.Tx)
if result, err = tx.ReleaseSavepoint(spanCtx, stmt.Name); err != nil {
return nil, 0, err
Expand Down
1 change: 0 additions & 1 deletion pkg/executor/single_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ func (executor *SingleDBExecutor) ExecutorComQuery(
if !ok {
return nil, 0, errors.New("there is no transaction")
}
defer executor.localTransactionMap.Delete(connectionID)
tx = txi.(proto.Tx)
if result, err = tx.ReleaseSavepoint(spanCtx, stmt.Name); err != nil {
return nil, 0, err
Expand Down
1 change: 0 additions & 1 deletion pkg/sql/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ func (tx *Tx) ReleaseSavepoint(ctx context.Context, savepoint string) (result pr
return nil, err2.ErrInvalidConn
}
result, err = tx.conn.Execute(ctx, fmt.Sprintf("RELEASE SAVEPOINT %s", savepoint), false)
tx.db.pool.Put(tx.conn)
return
}

Expand Down

0 comments on commit 47f1059

Please sign in to comment.