Skip to content

Commit 2a472df

Browse files
committed
add defer on val
1 parent c9ccd98 commit 2a472df

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sql/expression/enum.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ func (e *EnumToString) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
7070

7171
enumType := e.Enum.Type().(types.EnumType)
7272
var str string
73+
val, err = sql.UnwrapAny(ctx, val)
74+
if err != nil {
75+
return nil, err
76+
}
7377
switch v := val.(type) {
7478
case uint16:
7579
str, _ = enumType.At(int(v))

0 commit comments

Comments
 (0)