Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config, charset: make charset config not affected by collation config #30572

Merged
merged 5 commits into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {
xiongjiwei marked this conversation as resolved.
Show resolved Hide resolved
collate.EnableNewCharset()
}

newMemoryQuotaQuery, err := loadDefMemQuotaQuery(se)
Expand Down