From ecac72ad8bcaca549c8f06eec4d1350f8f763af6 Mon Sep 17 00:00:00 2001 From: xiezhaodong Date: Mon, 14 Apr 2025 20:17:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81lru=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prepare_stmt.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prepare_stmt.go b/prepare_stmt.go index 6324e6eb..624e5108 100644 --- a/prepare_stmt.go +++ b/prepare_stmt.go @@ -82,7 +82,9 @@ func (db *PreparedStmtDB) Close() { func (sdb *PreparedStmtDB) Reset() { sdb.Mux.Lock() defer sdb.Mux.Unlock() - + if sdb.Stmts == nil { + return + } for _, stmt := range sdb.Stmts.AllMap() { go func(s *Stmt) { // make sure the stmt must finish preparation first