Skip to content

there is a difference of crc32 of gbk charset table between tidb and mysql #30898

@Leavrth

Description

@Leavrth

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

In mysql 8.0.26:

mysql> create database `gbk` character set gbk;
mysql> use `gbk`;
mysql> create table t (id int, name varchar(20), primary key(`id`)) character set gbk;
mysql> insert into t (id, name) values (0, '你好0');

In TiDB:

Terminal> tiup playground --pd 1 --db 1 --kv 3 --db.config ./tidb.toml
mysql> create database `gbk` character set gbk;
mysql> use `gbk`;
mysql> create table t (id int, name varchar(20), primary key(`id`)) character set gbk;
mysql> insert into t (id, name) values (0, '你好0');

content in tidb.toml:

new_collations_enabled_on_first_bootstrap = true

[experimental]
enable-new-charset = true

2. What did you expect to see? (Required)

In mysql:

select CRC32(`name`) FROM `gbk`.`t`;
+---------------+
| CRC32(`name`) |
+---------------+
|     280664119 |
+---------------+
1 row in set (0.00 sec)

In TiDB

select CRC32(`name`) FROM `gbk`.`t`;
+---------------+
| CRC32(`name`) |
+---------------+
|    4115664031 |
+---------------+
1 row in set (0.00 sec)

3. What did you see instead (Required)

the result need to be the same

4. What is your TiDB version? (Required)

Release Version: v5.3.0
Edition: Community
Git Commit Hash: 4a1b2e9fe5b5afb1068c56de47adb07098d768d6
Git Branch: heads/refs/tags/v5.3.0
UTC Build Time: 2021-11-24 13:32:39
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false 

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions