Skip to content

Commit

Permalink
cherry pick pingcap#25535 to release-5.1
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
  • Loading branch information
tiancaiamao authored and ti-srebot committed Jul 23, 2021
1 parent fb0eaf7 commit eaf5a7a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ import (
"github.com/pingcap/tidb/util/sqlexec"
"github.com/pingcap/tidb/util/tableutil"
"github.com/pingcap/tidb/util/timeutil"
<<<<<<< HEAD
=======
tikvstore "github.com/tikv/client-go/v2/kv"
"github.com/tikv/client-go/v2/tikv"
tikvutil "github.com/tikv/client-go/v2/util"
>>>>>>> 9f18723e6... *: fix bug that write on temporary table send request to TiKV (#25535)
)

var (
Expand Down Expand Up @@ -538,6 +544,9 @@ func (s *session) doCommit(ctx context.Context) error {
if tables := s.GetSessionVars().TxnCtx.GlobalTemporaryTables; len(tables) > 0 {
s.txn.SetOption(kv.KVFilter, temporaryTableKVFilter(tables))
}
if tables := s.GetSessionVars().TxnCtx.GlobalTemporaryTables; len(tables) > 0 {
s.txn.SetOption(kv.KVFilter, temporaryTableKVFilter(tables))
}

return s.txn.Commit(tikvutil.SetSessionID(ctx, sessVars.ConnectionID))
}
Expand Down

0 comments on commit eaf5a7a

Please sign in to comment.