Skip to content

Commit

Permalink
session: remove useless parser object in SessionHandle of bindinfo pa…
Browse files Browse the repository at this point in the history
…ckage (#39439)
  • Loading branch information
winkyao authored Nov 29, 2022
1 parent f1215a5 commit 5b16086
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions bindinfo/session_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@ import (

// SessionHandle is used to handle all session sql bind operations.
type SessionHandle struct {
ch *bindCache
parser *parser.Parser
ch *bindCache
}

// NewSessionBindHandle creates a new SessionBindHandle.
func NewSessionBindHandle(parser *parser.Parser) *SessionHandle {
sessionHandle := &SessionHandle{parser: parser}
func NewSessionBindHandle() *SessionHandle {
sessionHandle := &SessionHandle{}
sessionHandle.ch = newBindCache()
return sessionHandle
}
Expand Down
2 changes: 1 addition & 1 deletion session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -3135,7 +3135,7 @@ func createSessionWithOpt(store kv.Storage, opt *Opt) (*session, error) {
s.sessionVars.BinlogClient = binloginfo.GetPumpsClient()
s.txn.init()

sessionBindHandle := bindinfo.NewSessionBindHandle(parser.New())
sessionBindHandle := bindinfo.NewSessionBindHandle()
s.SetValue(bindinfo.SessionBindInfoKeyType, sessionBindHandle)
s.SetSessionStatesHandler(sessionstates.StateBinding, sessionBindHandle)
return s, nil
Expand Down

0 comments on commit 5b16086

Please sign in to comment.