Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pkg/bindinfo/bind_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/pingcap/tidb/pkg/types"
"github.com/pingcap/tidb/pkg/util/hack"
"github.com/pingcap/tidb/pkg/util/hint"
"github.com/pkg/errors"
)

const (
Expand Down Expand Up @@ -172,7 +173,13 @@ func (br *BindRecord) FindBinding(hint string) *Binding {

// prepareHints builds ID and Hint for BindRecord. If sctx is not nil, we check if
// the BindSQL is still valid.
func (br *BindRecord) prepareHints(sctx sessionctx.Context) error {
func (br *BindRecord) prepareHints(sctx sessionctx.Context) (rerr error) {
defer func() {
if r := recover(); r != nil {
rerr = errors.Errorf("panic when preparing hints for binding, panic: %v", r)
}
}()

p := parser.New()
for i, bind := range br.Bindings {
if (bind.Hint != nil && bind.ID != "") || bind.Status == deleted {
Expand Down