From 5707469943ae0f0f6c87aba5b88e9b0efed4c06c Mon Sep 17 00:00:00 2001 From: keepstep Date: Wed, 15 Mar 2023 18:46:58 +0800 Subject: [PATCH] =?UTF-8?q?close=20mysql=20stmt.=20no=20doing=20close=20?= =?UTF-8?q?=20may=20cause=20the=20error=20:=20Can=E2=80=99t=20create=20mor?= =?UTF-8?q?e=20than=20max=5Fprepared=5Fstmt=5Fcount=20statements=20(curren?= =?UTF-8?q?t=20value:=2016382)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client_store.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client_store.go b/client_store.go index aba0481..48a95cf 100644 --- a/client_store.go +++ b/client_store.go @@ -75,6 +75,11 @@ func (s *ClientStore) initTable() error { if err != nil { return err } + + defer func() { + stmt.Close() + }() + _, err = stmt.Exec() if err != nil { return err