Skip to content

Commit e13f1e5

Browse files
jycorJames Cor
andauthored
fix textstorage panic (#2974)
Co-authored-by: James Cor <[email protected]>
1 parent 34df154 commit e13f1e5

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

enginetest/queries/script_queries.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8436,6 +8436,22 @@ where
84368436
},
84378437
},
84388438
},
8439+
{
8440+
Name: "hash tuples",
8441+
Dialect: "mysql",
8442+
SetUpScript: []string{
8443+
"CREATE TABLE test (id longtext);",
8444+
"INSERT INTO test (id) VALUES ('test_id');",
8445+
},
8446+
Assertions: []ScriptTestAssertion{
8447+
{
8448+
Query: "SELECT * FROM test WHERE id IN ('test_id');",
8449+
Expected: []sql.Row{
8450+
{"test_id"},
8451+
},
8452+
},
8453+
},
8454+
},
84398455
}
84408456

84418457
var SpatialScriptTests = []ScriptTest{

sql/expression/in.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,10 @@ func hashOfSimple(ctx *sql.Context, i interface{}, t sql.Type) (uint64, error) {
274274
if err != nil {
275275
return 0, err
276276
}
277-
str = converted.(string)
277+
str, _, err = sql.Unwrap[string](ctx, converted)
278+
if err != nil {
279+
return 0, err
280+
}
278281
}
279282
} else {
280283
x, err := convertOrTruncate(ctx, i, t.Promote())

0 commit comments

Comments
 (0)