Skip to content

Commit b7bba45

Browse files
committed
remove duplicate conversion to string
1 parent 797f25f commit b7bba45

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sql/expression/convert.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,7 @@ func convertValue(ctx *sql.Context, val interface{}, castTo string, originType s
312312
}
313313
return truncateConvertedValue(b, typeLength)
314314
case ConvertToChar, ConvertToNChar:
315-
val, _ = types.TypeAwareConversion(ctx, val, originType, types.LongText)
316-
s, _, err := types.LongText.Convert(ctx, val)
315+
s, err := types.TypeAwareConversion(ctx, val, originType, types.LongText)
317316
if err != nil {
318317
return nil, nil
319318
}

0 commit comments

Comments
 (0)