From 68eecc2b4a817497f5a9aacd650a812c48cdba96 Mon Sep 17 00:00:00 2001 From: winkyao Date: Mon, 28 Nov 2022 16:04:31 -0800 Subject: [PATCH] session: change parser.New to get a parser from pool --- session/bootstrap.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/session/bootstrap.go b/session/bootstrap.go index 678cc2c1832a3..ce25efa427349 100644 --- a/session/bootstrap.go +++ b/session/bootstrap.go @@ -2223,7 +2223,8 @@ func rebuildAllPartitionValueMapAndSorted(s *session) { PartitionExpr() (*tables.PartitionExpr, error) } - p := parser.New() + p := parserPool.Get().(*parser.Parser) + defer parserPool.Put(p) is := s.GetInfoSchema().(infoschema.InfoSchema) for _, dbInfo := range is.AllSchemas() { for _, t := range is.SchemaTables(dbInfo.Name) {