Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei committed Mar 8, 2024
1 parent 8c92f47 commit b25ac50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pkg/bindinfo/binding_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ func (fbc *fuzzyBindingCache) getFromMemory(sctx sessionctx.Context, fuzzyDigest
}

func (fbc *fuzzyBindingCache) loadFromStore(sctx sessionctx.Context, missingSQLDigest []string) {
failpoint.Inject("load_binding_nothing", func() {
failpoint.Return()
})
for _, sqlDigest := range missingSQLDigest {
start := time.Now()
bindings, err := fbc.loadBindingFromStorageFunc(sctx, sqlDigest)
Expand Down
4 changes: 2 additions & 2 deletions pkg/bindinfo/tests/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1109,12 +1109,12 @@ func TestFuzzyBindingHintsWithSourceReturning(t *testing.T) {
for _, currentDB := range []string{"db1", "db2", "db3"} {
tk.MustExec(`use ` + currentDB)
for _, db := range []string{"db1.", "db2.", "db3.", ""} {
require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/bindinfo/get_binding_return_nil", `return()`))
query := fmt.Sprintf(c.qTemplate, db)
tk.MustExec(query)
require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/bindinfo/get_binding_return_nil"))
tk.MustQuery(`show warnings`).Check(testkit.Rows()) // no warning
require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/bindinfo/get_binding_return_nil", `return()`))
tk.MustExec(query)
require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/bindinfo/get_binding_return_nil"))
tk.MustQuery(`select @@last_plan_from_binding`).Check(testkit.Rows("1"))
}
}
Expand Down

0 comments on commit b25ac50

Please sign in to comment.