diff --git a/ddl/db_integration_test.go b/ddl/db_integration_test.go index 89f42fad33..65439f822e 100644 --- a/ddl/db_integration_test.go +++ b/ddl/db_integration_test.go @@ -1295,7 +1295,7 @@ func (s *testIntegrationSuite) TestAlterAlgorithm(c *C) { s.tk.MustExec("alter table t default charset = utf8mb4, ALGORITHM=INSTANT") } -func (s *testIntegrationSuite) TestIgnoreColumnUTF8Charset(c *C) { +func (s *testIntegrationSuite) TestTreatOldVersionUTF8AsUTF8MB4(c *C) { s.tk = testkit.NewTestKit(c, s.store) s.tk.MustExec("use test") s.tk.MustExec("drop table if exists t") diff --git a/infoschema/builder.go b/infoschema/builder.go index 17b977bbec..42046820fa 100644 --- a/infoschema/builder.go +++ b/infoschema/builder.go @@ -199,7 +199,7 @@ func (b *Builder) applyCreateTable(m *meta.Meta, dbInfo *model.DBInfo, tableID i // ConvertOldVersionUTF8ToUTF8MB4IfNeed convert old version UTF8 to UTF8MB4 if config.TreatOldVersionUTF8AsUTF8MB4 is enable. func ConvertOldVersionUTF8ToUTF8MB4IfNeed(tbInfo *model.TableInfo) { - if !config.GetGlobalConfig().TreatOldVersionUTF8AsUTF8MB4 || tbInfo.Version >= model.TableInfoVersion2 { + if tbInfo.Version >= model.TableInfoVersion2 || !config.GetGlobalConfig().TreatOldVersionUTF8AsUTF8MB4 { return } if tbInfo.Charset == charset.CharsetUTF8 {