【 TiDB 使用环境】Poc
【 TiDB 版本】v7.2.0
【复现路径】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】
【资源配置】
【附件:截图/日志/监控】
reproduce test case:
- 先创建表,复制到 tiflash ,再增加 varchar 列, 可以通过 tikv/tiflash 正常查询。
create table tgbk (id int) charset = gbk;
create table tascii (id int) charset = ascii;
create table tbinary (id int) charset = binary;
create table tlatin1 (id int) charset = latin1;
create table tutf8mb4 (id int) charset = utf8mb4;
create table tutf8 (id int) charset = utf8;
create table t (id int);
alter table t set tiflash replica 1;
alter table tascii set tiflash replica 1;
alter table tbinary set tiflash replica 1;
alter table tgbk set tiflash replica 1;
alter table tlatin1 set tiflash replica 1;
alter table tutf8 set tiflash replica 1;
alter table tutf8mb4 set tiflash replica 1;
alter table t set tiflash replica 1;
alter table tascii set tiflash replica 1;
alter table tbinary set tiflash replica 1;
alter table tgbk set tiflash replica 1;
alter table tlatin1 set tiflash replica 1;
alter table tutf8 set tiflash replica 1;
alter table tutf8mb4 set tiflash replica 1;
insert t select 1;
insert tascii select 1;
insert tbinary select 1;
insert tgbk select 1;
insert tlatin1 select 1;
insert tutf8 select 1;
insert tutf8mb4 select 1;
set @@session.tidb_isolation_read_engines = 'tikv';
-- set @@session.tidb_isolation_read_engines = 'tiflash';
select * from t ;
select * from tascii ;
select * from tbinary ;
select * from tgbk ;
select * from tlatin1 ;
select * from tutf8 ;
select * from tutf8mb4 ;
set @@session.tidb_isolation_read_engines = 'tikv,tiflash';
alter table t add column c varchar(1);
alter table tascii add column c varchar(1);
alter table tbinary add column c varchar(1);
alter table tgbk add column c varchar(1);
alter table tlatin1 add column c varchar(1);
alter table tutf8 add column c varchar(1);
alter table tutf8mb4 add column c varchar(1);
update t set c = 'a';
update tascii set c = 'a';
update tbinary set c = 'a';
update tgbk set c = 'a';
update tlatin1 set c = 'a';
update tutf8 set c = 'a';
update tutf8mb4 set c = 'a';
- But, 先创建带有字符类型的表,写入数据后,再复制到 TiFlash,则只有 gbk 的表创建 TiFlash 副本失败。
create schema yandb2;
use yandb2;
create table tgbk (id int, c varchar(10)) charset = gbk;
create table tascii (id int, c varchar(10)) charset = ascii;
create table tbinary (id int, c varchar(10)) charset = binary;
create table tlatin1 (id int, c varchar(10)) charset = latin1;
create table tutf8mb4 (id int, c varchar(10)) charset = utf8mb4;
create table tutf8 (id int, c varchar(10)) charset = utf8;
create table t (id int, c varchar(10));
insert t select 1,'b';
insert tascii select 1,'b';
insert tbinary select 1,'b';
insert tgbk select 1,'b';
insert tlatin1 select 1,'b';
insert tutf8 select 1,'b';
insert tutf8mb4 select 1,'b';
alter table tascii set tiflash replica 1;
alter table tbinary set tiflash replica 1;
alter table tgbk set tiflash replica 1;
alter table tlatin1 set tiflash replica 1;
alter table tutf8 set tiflash replica 1;
alter table tutf8mb4 set tiflash replica 1;
PTAL~