diff --git a/go/mysql/collations/env.go b/go/mysql/collations/env.go index ae5419a5797..3e0c719acfa 100644 --- a/go/mysql/collations/env.go +++ b/go/mysql/collations/env.go @@ -100,10 +100,9 @@ func fetchCacheEnvironment(version collver) *Environment { // The version string must be in the format that is sent by the server as the version packet // when opening a new MySQL connection func NewEnvironment(serverVersion string) *Environment { - // 5.7 is the oldest version we support today, so use that as - // the default. - // NOTE: this should be changed when we EOL MySQL 5.7 support - var version collver = collverMySQL57 + // 8.0 is the oldest fully supported version, so use that as the default. + // All newer MySQL versions including 9 are so far compatible as well. + var version collver = collverMySQL8 serverVersion = strings.TrimSpace(strings.ToLower(serverVersion)) switch { case strings.HasSuffix(serverVersion, "-ripple"): @@ -125,8 +124,6 @@ func NewEnvironment(serverVersion string) *Environment { version = collverMySQL56 case strings.HasPrefix(serverVersion, "5.7."): version = collverMySQL57 - case strings.HasPrefix(serverVersion, "8."): - version = collverMySQL8 } return fetchCacheEnvironment(version) } diff --git a/go/mysql/collations/integration/main_test.go b/go/mysql/collations/integration/main_test.go index 23c6f8d2716..665a86ad266 100644 --- a/go/mysql/collations/integration/main_test.go +++ b/go/mysql/collations/integration/main_test.go @@ -47,7 +47,7 @@ func mysqlconn(t *testing.T) *mysql.Conn { if err != nil { t.Fatal(err) } - if !strings.HasPrefix(conn.ServerVersion, "8.") { + if strings.HasPrefix(conn.ServerVersion, "5.7.") { conn.Close() t.Skipf("collation integration tests are only supported in MySQL 8.0+") } diff --git a/go/vt/vtgate/evalengine/api_coerce.go b/go/vt/vtgate/evalengine/api_coerce.go index eef83c58422..f26ba5ea758 100644 --- a/go/vt/vtgate/evalengine/api_coerce.go +++ b/go/vt/vtgate/evalengine/api_coerce.go @@ -24,7 +24,7 @@ import ( ) func CoerceTo(value sqltypes.Value, typ Type, sqlmode SQLMode) (sqltypes.Value, error) { - cast, err := valueToEvalCast(value, value.Type(), collations.Unknown, typ.values, sqlmode) + cast, err := valueToEvalCast(value, value.Type(), typ.collation, typ.values, sqlmode) if err != nil { return sqltypes.Value{}, err }