Skip to content

Commit

Permalink
session, ddl: fix the nil point in TxnInfo (#44486) (#44507)
Browse files Browse the repository at this point in the history
close #43829
  • Loading branch information
ti-chi-bot authored Aug 8, 2023
1 parent 0397654 commit 398f4ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,9 @@ func (s *session) TxnInfo() *txninfo.TxnInfo {
}

processInfo := s.ShowProcess()
if processInfo == nil {
return nil
}
txnInfo.ConnectionID = processInfo.ID
txnInfo.Username = processInfo.User
txnInfo.CurrentDB = processInfo.DB
Expand Down Expand Up @@ -3704,13 +3707,10 @@ func GetStartTSFromSession(se interface{}) (uint64, uint64) {
logutil.BgLogger().Error("GetStartTSFromSession failed, can't transform to session struct")
return 0, 0
}
processInfo := tmp.ShowProcess()
if processInfo != nil {
processInfoID = processInfo.ID
}
txnInfo := tmp.TxnInfo()
if txnInfo != nil {
startTS = txnInfo.StartTS
processInfoID = txnInfo.ConnectionID
}

logutil.BgLogger().Debug(
Expand Down

0 comments on commit 398f4ce

Please sign in to comment.