Skip to content

Commit cfe6ceb

Browse files
author
James Cor
committed
more unsafe
1 parent 4689931 commit cfe6ceb

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

sql/types/decimal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ func (t DecimalType_) SQLValue(ctx *sql.Context, v sql.Value, dest []byte) (sqlt
351351
return sqltypes.NULL, nil
352352
}
353353
d := values.ReadDecimal(v.Val)
354-
return sqltypes.MakeTrusted(sqltypes.Decimal, []byte(t.DecimalValueStringFixed(d))), nil
354+
return sqltypes.MakeTrusted(sqltypes.Decimal, encodings.StringToBytes(t.DecimalValueStringFixed(d))), nil
355355
}
356356

357357
// String implements Type interface.

sql/types/enum.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func (t EnumType) SQLValue(ctx *sql.Context, v sql.Value, dest []byte) (sqltypes
289289
}
290290

291291
// TODO: write append style encoder
292-
res, ok := charset.Encoder().Encode([]byte(value))
292+
res, ok := charset.Encoder().Encode(encodings.StringToBytes(value))
293293
if !ok {
294294
if len(value) > 50 {
295295
value = value[:50]

sql/types/set.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func (t SetType) SQLValue(ctx *sql.Context, v sql.Value, dest []byte) (sqltypes.
285285
}
286286

287287
// TODO: write append style encoder
288-
res, ok := resultCharset.Encoder().Encode([]byte(value))
288+
res, ok := resultCharset.Encoder().Encode(encodings.StringToBytes(value))
289289
if !ok {
290290
if len(value) > 50 {
291291
value = value[:50]

0 commit comments

Comments
 (0)