File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ go_library(
37
37
"//pkg/util/stmtsummary/v2:stmtsummary" ,
38
38
"//pkg/util/table-filter" ,
39
39
"//pkg/util/timeutil" ,
40
+ "@com_github_pkg_errors//:errors" ,
40
41
"@org_golang_x_exp//maps" ,
41
42
"@org_uber_go_zap//:zap" ,
42
43
],
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import (
24
24
"github.com/pingcap/tidb/pkg/types"
25
25
"github.com/pingcap/tidb/pkg/util/hack"
26
26
"github.com/pingcap/tidb/pkg/util/hint"
27
+ "github.com/pkg/errors"
27
28
)
28
29
29
30
const (
@@ -172,7 +173,13 @@ func (br *BindRecord) FindBinding(hint string) *Binding {
172
173
173
174
// prepareHints builds ID and Hint for BindRecord. If sctx is not nil, we check if
174
175
// the BindSQL is still valid.
175
- func (br * BindRecord ) prepareHints (sctx sessionctx.Context ) error {
176
+ func (br * BindRecord ) prepareHints (sctx sessionctx.Context ) (rerr error ) {
177
+ defer func () {
178
+ if r := recover (); r != nil {
179
+ rerr = errors .Errorf ("panic when preparing hints for binding, panic: %v" , r )
180
+ }
181
+ }()
182
+
176
183
p := parser .New ()
177
184
for i , bind := range br .Bindings {
178
185
if (bind .Hint != nil && bind .ID != "" ) || bind .Status == deleted {
You can’t perform that action at this time.
0 commit comments