Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session: remove useless parser object in SessionHandle of bindinfo package #39439

Merged
merged 7 commits into from
Nov 29, 2022
Merged
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 @@ -3137,7 +3137,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