From 5b16086d98d05e89cd888665c981b29fac38de61 Mon Sep 17 00:00:00 2001 From: winkyao Date: Mon, 28 Nov 2022 19:03:59 -0800 Subject: [PATCH] session: remove useless parser object in SessionHandle of bindinfo package (#39439) --- bindinfo/session_handle.go | 7 +++---- session/session.go | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/bindinfo/session_handle.go b/bindinfo/session_handle.go index e6baebe3ea960..a2e03931798a8 100644 --- a/bindinfo/session_handle.go +++ b/bindinfo/session_handle.go @@ -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 } diff --git a/session/session.go b/session/session.go index a6f5bf4cad0f1..74c5aa5730bd6 100644 --- a/session/session.go +++ b/session/session.go @@ -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