Skip to content

Commit

Permalink
address
Browse files Browse the repository at this point in the history
  • Loading branch information
wshwsh12 committed Apr 28, 2021
1 parent bd2fe7f commit 2543bee
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions util/ranger/points.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import (
"github.com/pingcap/tidb/util/chunk"
"github.com/pingcap/tidb/util/collate"
"github.com/pingcap/tidb/util/dbterror"
"github.com/pingcap/tidb/util/logutil"
"go.uber.org/zap"
)

// Error instances.
Expand Down Expand Up @@ -446,12 +444,11 @@ func handleEnumFromBinOp(sc *stmtctx.StatementContext, ft *types.FieldType, val
res = append(res, &point{value: d, excl: false, start: false})
}

tmpEnum := types.Enum{}
for i := range ft.Elems {
enum, err := types.ParseEnumValue(ft.Elems, uint64(i+1))
if err != nil {
logutil.BgLogger().Error("Internal error: build internal enum error", zap.Error(err))
}
d := types.NewMysqlEnumDatum(enum)
tmpEnum.Name = ft.Elems[i]
tmpEnum.Value = uint64(i)
d := types.NewMysqlEnumDatum(tmpEnum)
if v, err := d.CompareDatum(sc, &val); err == nil {
switch op {
case ast.LT:
Expand Down

0 comments on commit 2543bee

Please sign in to comment.