Skip to content

Commit 44f2157

Browse files
author
James Cor
committed
replace append with cast
1 parent bccff37 commit 44f2157

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

sql/types/decimal.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ func (t DecimalType_) SQL(ctx *sql.Context, dest []byte, v interface{}) (sqltype
303303
if err != nil {
304304
return sqltypes.Value{}, err
305305
}
306-
val := AppendAndSliceString(dest, t.DecimalValueStringFixed(value.Decimal))
306+
//val := AppendAndSliceString(dest, t.DecimalValueStringFixed(value.Decimal))
307+
val := []byte(t.DecimalValueStringFixed(value.Decimal))
307308
return sqltypes.MakeTrusted(sqltypes.Decimal, val), nil
308309
}
309310

sql/types/json.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ func (t JsonType) SQL(ctx *sql.Context, dest []byte, v interface{}) (sqltypes.Va
154154
if err != nil {
155155
return sqltypes.NULL, err
156156
}
157-
val = AppendAndSliceString(dest, str)
157+
//val = AppendAndSliceString(dest, str)
158+
val = []byte(str)
158159
}
159160

160161
return sqltypes.MakeTrusted(sqltypes.TypeJSON, val), nil

sql/types/system_enum.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ func (t systemEnumType) SQL(ctx *sql.Context, dest []byte, v interface{}) (sqlty
157157
return sqltypes.Value{}, err
158158
}
159159

160-
val := AppendAndSliceString(dest, v.(string))
160+
//val := AppendAndSliceString(dest, v.(string))
161+
val := []byte(v.(string))
161162

162163
return sqltypes.MakeTrusted(t.Type(), val), nil
163164
}

sql/types/system_set.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ func (t systemSetType) SQL(ctx *sql.Context, dest []byte, v interface{}) (sqltyp
143143
return sqltypes.Value{}, err
144144
}
145145

146-
val := AppendAndSliceString(dest, value)
146+
//val := AppendAndSliceString(dest, value)
147+
val := []byte(value)
147148

148149
return sqltypes.MakeTrusted(t.Type(), val), nil
149150
}

sql/types/system_string.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ func (t systemStringType) SQL(ctx *sql.Context, dest []byte, v interface{}) (sql
102102
return sqltypes.Value{}, err
103103
}
104104

105-
val := AppendAndSliceString(dest, v.(string))
105+
//val := AppendAndSliceString(dest, v.(string))
106+
val := []byte(v.(string))
106107

107108
return sqltypes.MakeTrusted(t.Type(), val), nil
108109
}

0 commit comments

Comments
 (0)