summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/r/instant_alter_import.result
blob: 2d9a39f788611d16fd176259d6d813a6b3730079 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
set default_storage_engine=innodb;
#
# MDEV-18295 IMPORT TABLESPACE fails with instant-altered tables
#
create table t2 (x int, z int default 41);
alter table t2 discard tablespace;
create table t1 (x int);
insert into t1 values (1);
alter table t1 add z int default 42, algorithm instant;
select * from t1;
x	z
1	42
flush tables t1 for export;
unlock tables;
# The metadata has to be updated to instant ADD COLUMN.
alter table t2 import tablespace;
select * from t2;
x	z
1	42
insert into t2 set x=2;
select * from t2;
x	z
1	42
2	41
alter table t1 discard tablespace;
flush tables t2 for export;
unlock tables;
# Both the metadata and the data file used instant ADD COLUMN.
alter table t1 import tablespace;
select * from t1;
x	z
1	42
2	41
drop table t2;
create table t2 select * from t1;
alter table t1 discard tablespace;
flush tables t2 for export;
unlock tables;
# The instant ADD COLUMN has to be removed from the metadata.
alter table t1 import tablespace;
select * from t1;
x	z
1	42
2	41
# Remove metadata for instant DROP COLUMN, then import
alter table t1 drop x, add column x int first, algorithm instant;
select * from t1;
x	z
NULL	42
NULL	41
alter table t1 discard tablespace;
alter table t1 import tablespace;
select * from t1;
x	z
1	42
2	41
# Import a data file that contains instant DROP COLUMN metadata
alter table t2 drop x;
alter table t1 drop x, force;
alter table t1 discard tablespace;
flush tables t2 for export;
unlock tables;
alter table t1 import tablespace;
ERROR HY000: Schema mismatch (Index field count 4 doesn't match tablespace metadata file value 5)
select * from t1;
ERROR HY000: Tablespace has been discarded for table `t1`
alter table t1 import tablespace;
ERROR HY000: Internal error: Cannot reset LSNs in table `test`.`t1` : Unsupported
select * from t1;
ERROR HY000: Tablespace has been discarded for table `t1`
drop table t2;
drop table t1;