Skip to content

Commit

Permalink
config, charset: make charset config not affected by collation config (
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongjiwei authored and disksing committed Jan 26, 2022
1 parent eed16a6 commit 92a8110
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
17 changes: 17 additions & 0 deletions executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5797,6 +5797,23 @@ func (s *testSuiteWithCliBaseCharset) TestCharsetFeature(c *C) {
" `a` char(10) DEFAULT NULL\n" +
") ENGINE=InnoDB DEFAULT CHARSET=gbk COLLATE=gbk_chinese_ci",
))

collate.SetNewCollationEnabledForTest(false)
tk.MustQuery("show charset").Check(testkit.Rows(
"ascii US ASCII ascii_bin 1",
"binary binary binary 1",
"gbk Chinese Internal Code Specification gbk_chinese_ci 2",
"latin1 Latin1 latin1_bin 1",
"utf8 UTF-8 Unicode utf8_bin 3",
"utf8mb4 UTF-8 Unicode utf8mb4_bin 4",
))
tk.MustQuery("show collation").Check(testkit.Rows(
"utf8mb4_bin utf8mb4 46 Yes Yes 1",
"latin1_bin latin1 47 Yes Yes 1",
"binary binary 63 Yes Yes 1",
"ascii_bin ascii 65 Yes Yes 1",
"utf8_bin utf8 83 Yes Yes 1",
))
}

func (s *testSuiteWithCliBaseCharset) TestCharsetFeatureCollation(c *C) {
Expand Down
6 changes: 3 additions & 3 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -2535,9 +2535,9 @@ func BootstrapSession(store kv.Storage) (*domain.Domain, error) {

if newCollationEnabled {
collate.EnableNewCollations()
if cfg.Experimental.EnableNewCharset {
collate.EnableNewCharset()
}
}
if cfg.Experimental.EnableNewCharset {
collate.EnableNewCharset()
}

newMemoryQuotaQuery, err := loadDefMemQuotaQuery(se)
Expand Down

0 comments on commit 92a8110

Please sign in to comment.