From d8c76225f2685bedf110a6028938c9977f496f3a Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Tue, 12 Mar 2024 18:00:50 +0800 Subject: [PATCH] linter Signed-off-by: Weizhen Wang --- pkg/bindinfo/binding_cache.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/bindinfo/binding_cache.go b/pkg/bindinfo/binding_cache.go index 9c32edd6de597..1a9851862c3d1 100644 --- a/pkg/bindinfo/binding_cache.go +++ b/pkg/bindinfo/binding_cache.go @@ -108,14 +108,16 @@ func (fbc *fuzzyBindingCache) getFromMemory(sctx sessionctx.Context, fuzzyDigest enableFuzzyBinding := sctx.GetSessionVars().EnableFuzzyBinding for _, sqlDigest := range fbc.fuzzy2SQLDigests[fuzzyDigest] { bindings := bindingCache.GetBinding(sqlDigest) - if intest.InTest && sctx.Value(GetBindingReturnNil) != nil { - if GetBindingReturnNilBool.CompareAndSwap(false, true) { + if intest.InTest { + if sctx.Value(GetBindingReturnNil) != nil { + if GetBindingReturnNilBool.CompareAndSwap(false, true) { + bindings = nil + } + } + if sctx.Value(GetBindingReturnNilAlways) != nil { bindings = nil } } - if intest.InTest && sctx.Value(GetBindingReturnNilAlways) != nil { - bindings = nil - } if bindings != nil { for _, binding := range bindings { numWildcards, matched := fuzzyMatchBindingTableName(sctx.GetSessionVars().CurrentDB, tableNames, binding.TableNames)