Skip to content

Commit

Permalink
Fix fullstack test
Browse files Browse the repository at this point in the history
Signed-off-by: JaySon-Huang <[email protected]>
  • Loading branch information
JaySon-Huang committed Sep 26, 2022
1 parent b6a59d1 commit 4bfcc0a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/fullstack-test2/ddl/alter_pk.test
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ mysql> alter table test.t drop primary key;

# issue 5859, case 1
mysql> drop table if exists test.t_case;
## create table with `source` is nullable
## insert some data and left `source` to be empty
mysql> create table test.t_case (`case_no` varchar(32) not null,`source` varchar(20) default null,`p` varchar(12) DEFAULT NULL,primary key (`case_no`));
## create table with source is nullable
## insert some data and left source to be empty
mysql> create table test.t_case (case_no varchar(32) not null,source varchar(20) default null,p varchar(12) DEFAULT NULL,primary key (case_no));
mysql> insert into test.t_case(case_no) values ("1"), ("2"), ("3"), ("4");

## drop the primary key, fill the `source` to be non-empty
## drop the primary key, fill the source to be non-empty
## add new primary key with case_no and source
mysql> alter table test.t_case drop primary key;
mysql> update test.t_case set `source` = '' where `source` is NULL;
mysql> alter table test.t_case add primary key (`case_no`, `source`);
mysql> update test.t_case set source = '' where source is NULL;
mysql> alter table test.t_case add primary key (case_no, source);

## send the snapshot data to tiflash
mysql> alter table test.t_case set tiflash replica 1;
Expand All @@ -73,14 +73,14 @@ mysql> select case_no,p,source from test.t_case;

# issue 5859, case 2
mysql> drop table if exists test.t_case;
## create table with `case_no`
mysql> create table test.t_case (`case_no` varchar(32) not null,`p` varchar(12) DEFAULT NULL,primary key (`case_no`));
## create table with case_no
mysql> create table test.t_case (case_no varchar(32) not null,p varchar(12) DEFAULT NULL,primary key (case_no));
mysql> insert into test.t_case(case_no) values ("1"), ("2"), ("3"), ("4");

mysql> alter table test.t_case add column `source` varchar(20) not null;
mysql> alter table test.t_case add column source varchar(20) not null;
## drop the primary key, add new primary key with case_no and source
mysql> alter table test.t_case drop primary key;
mysql> alter table test.t_case add primary key (`case_no`, `source`);
mysql> alter table test.t_case add primary key (case_no, source);

## send the snapshot data to tiflash
mysql> alter table test.t_case set tiflash replica 1;
Expand Down

0 comments on commit 4bfcc0a

Please sign in to comment.