Open dveeden opened 2 weeks ago
Many places use a int or uint8 for the Collation ID. This breaks collations with an ID above 255.
int
uint8
$ git grep -iE 'collation *(uint8|int)(,|$|\ )' pkg/server/conn.go: collation uint8 // collation used by client, may be different from the collation used by database. pkg/server/driver.go: OpenCtx(connID uint64, capability uint32, collation uint8, dbname string, tlsState *tls.ConnectionState, extensions *extension.SessionExtensions) (*TiDBContext, error) pkg/server/driver_tidb.go:func (qd *TiDBDriver) OpenCtx(connID uint64, capability uint32, collation uint8, _ string, pkg/server/internal/handshake/handshake.go: Collation uint8
https://github.com/pingcap/tidb/blob/c60f97d16c6ff981b16279254ddee0f6b0e8ef19/pkg/parser/charset/charset.go#L47
Also there is quite a bit of duplication between these:
pkg/parser/mysql/charset.go
pkg/parser/charset/charset.go
Bug Report
Many places use a
int
oruint8
for the Collation ID. This breaks collations with an ID above 255.https://github.com/pingcap/tidb/blob/c60f97d16c6ff981b16279254ddee0f6b0e8ef19/pkg/parser/charset/charset.go#L47
Also there is quite a bit of duplication between these:
pkg/parser/mysql/charset.go
pkg/parser/charset/charset.go