Skip to content

Commit 656d0b8

Browse files
committed
amend with review suggestions
1 parent 9922a91 commit 656d0b8

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

enginetest/queries/script_queries.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9355,7 +9355,7 @@ where
93559355
},
93569356
},
93579357
{
9358-
Name: "enum conversion to strings",
9358+
Name: "enum conversions",
93599359
Dialect: "mysql",
93609360
SetUpScript: []string{
93619361
"create table t (e enum('abc', 'defg', 'hijkl'));",
@@ -9985,7 +9985,7 @@ where
99859985
},
99869986
},
99879987
{
9988-
Name: "set conversion to strings",
9988+
Name: "set conversions",
99899989
Dialect: "mysql",
99909990
SetUpScript: []string{
99919991
"create table t (s set('abc', 'defg', 'hijkl'));",

sql/expression/convert.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,6 @@ func (c *Convert) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
280280

281281
// convertValue converts a value from its current type to the specified target type for CAST/CONVERT operations.
282282
// It handles type-specific conversion logic and applies length/scale constraints where applicable.
283-
// For SET/ENUM types converting to text types, uses TypeAwareConversion for proper string representation.
284-
// For SET/ENUM types converting to binary types, converts to string first before applying binary conversion.
285283
// If |typeLength| and |typeScale| are 0, they are ignored, otherwise they are used as constraints on the
286284
// converted type where applicable (e.g. Char conversion supports only |typeLength|, Decimal conversion supports
287285
// |typeLength| and |typeScale|).
@@ -293,7 +291,6 @@ func convertValue(ctx *sql.Context, val interface{}, castTo string, originType s
293291
}
294292
switch strings.ToLower(castTo) {
295293
case ConvertToBinary:
296-
// For SET/ENUM types, convert to string first for blob conversions
297294
if types.IsSet(originType) || types.IsEnum(originType) {
298295
val, _ = types.TypeAwareConversion(ctx, val, originType, types.LongText)
299296
}

0 commit comments

Comments
 (0)