Skip to content

Commit

Permalink
cherry pick 40024 to fix unstable TestMaxPreparedStmtCount
Browse files Browse the repository at this point in the history
  • Loading branch information
xuyifangreeneyes committed Apr 14, 2023
1 parent a706515 commit 2c062e8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions executor/prepared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"fmt"
"strconv"
"strings"
"sync/atomic"
"testing"

"github.com/pingcap/tidb/parser/auth"
Expand Down Expand Up @@ -1254,6 +1255,11 @@ func TestIssue31141(t *testing.T) {
}

func TestMaxPreparedStmtCount(t *testing.T) {
oldVal := atomic.LoadInt64(&variable.PreparedStmtCount)
atomic.StoreInt64(&variable.PreparedStmtCount, 0)
defer func() {
atomic.StoreInt64(&variable.PreparedStmtCount, oldVal)
}()
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
tk.MustExec("set @@global.max_prepared_stmt_count = 2")
Expand Down

0 comments on commit 2c062e8

Please sign in to comment.