Skip to content

Commit

Permalink
follow comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Defined2014 committed Nov 26, 2021
1 parent cab20f7 commit 37bd804
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ddl/ddl_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -4723,8 +4723,8 @@ func (d *ddl) AlterTableSetTiFlashReplica(ctx sessionctx.Context, ident ast.Iden

// Ban setting replica count for tables which has charset not supported by TiFlash
for _, col := range tb.Cols() {
_, v := charset.TiFlashSupportedCharsets[col.Charset]
if !v {
_, ok := charset.TiFlashSupportedCharsets[col.Charset]
if !ok {
return errAlterReplicaForUnsupportedCharsetTable.GenWithStackByArgs(col.Charset)
}
}
Expand Down
12 changes: 6 additions & 6 deletions parser/charset/charset.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ var supportedCollationNames = map[string]struct{}{
}

// TiFlashSupportedCharsets is a map which contains TiFlash supports charsets.
var TiFlashSupportedCharsets = map[string]bool{
CharsetUTF8: true,
CharsetUTF8MB4: true,
CharsetASCII: true,
CharsetLatin1: true,
CharsetBin: true,
var TiFlashSupportedCharsets = map[string]struct{}{
CharsetUTF8: {},
CharsetUTF8MB4: {},
CharsetASCII: {},
CharsetLatin1: {},
CharsetBin: {},
}

// GetSupportedCharsets gets descriptions for all charsets supported so far.
Expand Down

0 comments on commit 37bd804

Please sign in to comment.