Skip to content

Commit

Permalink
expression: enum/set could be invalid during evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
winoros committed Dec 18, 2023
1 parent 7c58082 commit ce864de
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/expression/chunk_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
package expression

import (
"github.com/pingcap/errors"
"github.com/pingcap/tidb/pkg/parser/ast"
"github.com/pingcap/tidb/pkg/parser/mysql"
"github.com/pingcap/tidb/pkg/sessionctx"
"github.com/pingcap/tidb/pkg/types"
"github.com/pingcap/tidb/pkg/util/chunk"
"github.com/pingcap/tidb/pkg/util/logutil"
"go.uber.org/zap"
)

// Vectorizable checks whether a list of expressions can employ vectorized execution.
Expand Down Expand Up @@ -182,7 +183,7 @@ func evalOneVec(ctx sessionctx.Context, expr Expression, input *chunk.Chunk, out
} else {
enum, err := types.ParseEnumName(ft.GetElems(), result.GetString(i), ft.GetCollate())
if err != nil {
return errors.Errorf("Wrong enum value parsed during evaluation")
logutil.BgLogger().Debug("Wrong enum value parsed during evaluation", zap.Error(err))
}
buf.AppendEnum(enum)
}
Expand All @@ -198,7 +199,7 @@ func evalOneVec(ctx sessionctx.Context, expr Expression, input *chunk.Chunk, out
} else {
set, err := types.ParseSetName(ft.GetElems(), result.GetString(i), ft.GetCollate())
if err != nil {
return errors.Errorf("Wrong set value parsed during evaluation")
logutil.BgLogger().Debug("Wrong set value parsed during evaluation", zap.Error(err))
}
buf.AppendSet(set)
}
Expand Down

0 comments on commit ce864de

Please sign in to comment.