ddl: fix data race of config.TreatOldVersionUTF8AsUTF8MB4 (#9960)
This commit is contained in:
@ -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")
|
||||
|
||||
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user