Skip to content

br restore failed with "Unknown character set: 'gbk'" if table CHARSET=gbk #31297

@fubinzh

Description

@fubinzh

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. Create tidb cluster with below parameters:
new_collations_enabled_on_first_bootstrap = true
[experimental]
enable-new-charset = true
  1. Create table with charset gbk
create database gbktest; 
use gbktest;
create table gbk1(a int primary key, b varchar(20) charset gbk) collate gbk_bin; 
insert into gbk1 value (1, "GBK测试");
  1. Use br to backup the db
./br backup db --pd "172.16.6.217:2379" --db gbktest --storage "local:///home/tools_test_data/gbktest_backup"
  1. Use br to restore the db

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

Restore table whose charset = gbk should succeed.

3. What did you see instead (Required)

Restore failed

[root@centos76_vm v5.4.0]#  ./br restore db --pd "172.16.6.217:2379" --db gbktest --storage "local:///home/tools_test_data/gbktest_backup"
Detail BR log in /tmp/br.log.2022-01-04T18.47.15+0800
Database restore <---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 100.00%
[2022/01/04 18:47:15.801 +08:00] [INFO] [collector.go:67] ["Database restore failed summary"] [total-ranges=0] [ranges-succeed=0] [ranges-failed=0] [split-region=3.309264ms] [restore-ranges=1]
Error: [ddl:1115]Unknown character set: 'gbk'

4. What is your TiDB version? (Required)

[root@centos76_vm v5.4.0]# ./br -V
Release Version: v5.4.0
Git Commit Hash: 974b578
Git Branch: heads/refs/tags/v5.4.0
Go Version: go1.16.4
UTC Build Time: 2022-01-04 07:43:43
Race Enabled: false

Metadata

Metadata

Assignees

Labels

affects-5.4This bug affects the 5.4.x(LTS) versions.component/brThis issue is related to BR of TiDB.severity/criticaltype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions