| 1 |
****************************** |
| 2 |
Tests for unsupported features |
| 3 |
****************************** |
| 4 |
create table test.t1 (a varchar(20) not null, |
| 5 |
b varchar(20) not null, |
| 6 |
c varchar(20) not null, |
| 7 |
d varchar(20) not null, |
| 8 |
e varchar(20), |
| 9 |
primary key(a,b)) engine=ndb; |
| 10 |
insert into test.t1 values |
| 11 |
("1a","1b","1c","1d","1e"), |
| 12 |
("2a","2b","2c","2d","2e"), |
| 13 |
("3a","3b","3c","3d","3e"), |
| 14 |
("4a","4b","4c","4d","4e"), |
| 15 |
("5a","5b","5c","5d","5e"), |
| 16 |
("6a","6b","6c","6d","6e"); |
| 17 |
Stall backup completion |
| 18 |
Run backup |
| 19 |
Starting backup |
| 20 |
Backup started |
| 21 |
Make some changes which will be logged... |
| 22 |
insert into test.t1 values |
| 23 |
("7a","7b","7c","7d","7e"), |
| 24 |
("8a","8b","8c","8d","8e"), |
| 25 |
("9a","9b","9c","9d","9e"); |
| 26 |
update test.t1 set d=concat(d, "-modified"); |
| 27 |
update test.t1 set c=concat(c, "-modified") where a in ("1a", "2a", "3a"); |
| 28 |
update test.t1 set c=concat(c, "2"), d=concat(d, "2"), e=concat(e,"-modified") where a in ("4a", "5a", "6a"); |
| 29 |
delete from test.t1 where a in ("5a","8a"); |
| 30 |
Allow backup to complete... |
| 31 |
Waiting for backup to complete |
| 32 |
Backup completed |
| 33 |
select * from test.t1 order by a; |
| 34 |
a b c d e |
| 35 |
1a 1b 1c-modified 1d-modified 1e |
| 36 |
2a 2b 2c-modified 2d-modified 2e |
| 37 |
3a 3b 3c-modified 3d-modified 3e |
| 38 |
4a 4b 4c2 4d-modified2 4e-modified |
| 39 |
6a 6b 6c2 6d-modified2 6e-modified |
| 40 |
7a 7b 7c 7d-modified 7e |
| 41 |
9a 9b 9c 9d-modified 9e |
| 42 |
drop table test.t1; |
| 43 |
Show that we cannot change pk without --allow-pk-changes |
| 44 |
Extend PK (a,b) -> (a,b,c) |
| 45 |
create table test.t1 (a varchar(20) not null, |
| 46 |
b varchar(20) not null, |
| 47 |
c varchar(20) not null, |
| 48 |
d varchar(20) not null, |
| 49 |
e varchar(20), |
| 50 |
primary key(a,b,c)) engine=ndb; |
| 51 |
Run restore |
| 52 |
Expect error |
| 53 |
File contains row(s) matching pattern without allow-pk-changes |
| 54 |
drop table test.t1; |
| 55 |
Show that we cannot change pk if the new column has updates |
| 56 |
with --ignore-extended-pk-updates |
| 57 |
create table test.t1 (a varchar(20) not null, |
| 58 |
b varchar(20) not null, |
| 59 |
c varchar(20) not null, |
| 60 |
d varchar(20) not null, |
| 61 |
e varchar(20), |
| 62 |
primary key(a,b,c)) engine=ndb; |
| 63 |
Run restore |
| 64 |
Expect error |
| 65 |
File contains row(s) matching pattern ignore-extended-pk-updates switch is missing |
| 66 |
drop table test.t1; |
| 67 |
Show that we cannot add a pk column from nowhere |
| 68 |
create table test.t1 (a varchar(20) not null, |
| 69 |
b varchar(20) not null, |
| 70 |
c varchar(20) not null, |
| 71 |
d varchar(20) not null, |
| 72 |
e varchar(20), |
| 73 |
x varchar(20) not null, |
| 74 |
primary key(a,b,x)) engine=ndb; |
| 75 |
Run restore |
| 76 |
Expect error |
| 77 |
File contains row(s) matching pattern structure incompatible |
| 78 |
drop table test.t1; |
| 79 |
Show that we cannot add an autoincrement pk from nowhere |
| 80 |
create table test.t1 (a varchar(20) not null, |
| 81 |
b varchar(20) not null, |
| 82 |
c varchar(20) not null, |
| 83 |
d varchar(20) not null, |
| 84 |
e varchar(20), |
| 85 |
x int auto_increment not null, |
| 86 |
primary key(a,b,x)) engine=ndb; |
| 87 |
Run restore |
| 88 |
Expect error |
| 89 |
File contains row(s) matching pattern structure incompatible |
| 90 |
drop table test.t1; |
| 91 |
Complete key change with nothing of old key remaining |
| 92 |
Will fail as the log apply lookup for update/delete |
| 93 |
needs an index which has nothing to index |
| 94 |
|
| 95 |
create table test.t1 (c varchar(20) not null, |
| 96 |
d varchar(20) not null, |
| 97 |
e varchar(20), |
| 98 |
primary key(c,d)) engine=ndb; |
| 99 |
Run restore |
| 100 |
File contains row(s) matching pattern no columns |
| 101 |
drop table test.t1; |