Debian Codegraph @

mysql-test/suite/innodb/t/import_cfg.test

raw
1 --source include/have_innodb.inc
2 --let $datadir= `select @@datadir`
3
4 --echo #
5 --echo # MDEV-35169 ALTER TABLE...IMPORT TABLESPACE does not
6 --echo # work with INDEX DESC
7 --echo #
8
9 --echo # prepare cfg for primary key with desc column
10 create table t1 (pk int, a int, primary key(pk desc)) engine=InnoDB;
11 insert into t1 values (1,10),(2,20),(3,15);
12 flush table t1 for export;
13 --copy_file $datadir/test/t1.ibd $datadir/test/t1_pk.ibd.desc
14 --copy_file $datadir/test/t1.cfg $datadir/test/t1_pk.cfg.desc
15 unlock tables;
16 drop table t1;
17
18 --echo # prepare cfg for secondary index with desc column
19 create table t1 (pk int primary key, a int,key(a desc)) engine=InnoDB;
20 insert into t1 values (1,10),(2,20),(3,15);
21 flush table t1 for export;
22 --copy_file $datadir/test/t1.ibd $datadir/test/t1.ibd.desc
23 --copy_file $datadir/test/t1.cfg $datadir/test/t1.cfg.desc
24 unlock tables;
25 drop table t1;
26
27 --echo # prepare cfg for secondary index with ascending column
28 create table t1 (pk int primary key, a int, key(a)) engine=InnoDB;
29 insert into t1 values (1,10),(2,20),(3,15);
30 flush table t1 for export;
31 --copy_file $datadir/test/t1.ibd $datadir/test/t1.ibd.asc
32 --copy_file $datadir/test/t1.cfg $datadir/test/t1.cfg.asc
33 unlock tables;
34 drop table t1;
35
36 --echo # Import desc tablespace into desc frm
37
38 --echo # Import into table with desc primary key column
39 create table t1 (pk int, a int, primary key(pk desc)) engine=InnoDB;
40 alter table t1 discard tablespace;
41 --copy_file $datadir/test/t1_pk.ibd.desc $datadir/test/t1.ibd
42 --copy_file $datadir/test/t1_pk.cfg.desc $datadir/test/t1.cfg
43 alter table t1 import tablespace;
44 check table t1 extended;
45 drop table t1;
46
47 --echo # Import into table with desc secondary index
48 create table t1 (pk int primary key, a int, key(a desc))engine=InnoDB;
49 alter table t1 discard tablespace;
50 --copy_file $datadir/test/t1.ibd.desc $datadir/test/t1.ibd
51 --copy_file $datadir/test/t1.cfg.desc $datadir/test/t1.cfg
52 alter table t1 import tablespace;
53 check table t1 extended;
54 drop table t1;
55
56 --echo # Import asc tablespace into desc frm
57 create table t1 (pk int primary key, a int, key(a desc))engine=InnoDB;
58 alter table t1 discard tablespace;
59 --copy_file $datadir/test/t1.ibd.asc $datadir/test/t1.ibd
60 --copy_file $datadir/test/t1.cfg.asc $datadir/test/t1.cfg
61 --error ER_TABLE_SCHEMA_MISMATCH
62 alter table t1 import tablespace;
63 check table t1 extended;
64 drop table t1;
65
66 --echo # Import desc tablespace into asc frm
67 create table t1 (pk int primary key, a int, key(a)) engine=InnoDB;
68 alter table t1 discard tablespace;
69 --copy_file $datadir/test/t1.ibd.desc $datadir/test/t1.ibd
70 --copy_file $datadir/test/t1.cfg.desc $datadir/test/t1.cfg
71 --error ER_TABLE_SCHEMA_MISMATCH
72 alter table t1 import tablespace;
73 check table t1 extended;
74 drop table t1;
75
76 --echo # Import asc tablespace into asc frm
77 create table t1 (pk int primary key, a int, key(a)) engine=InnoDB;
78 alter table t1 discard tablespace;
79 --copy_file $datadir/test/t1.ibd.asc $datadir/test/t1.ibd
80 --copy_file $datadir/test/t1.cfg.asc $datadir/test/t1.cfg
81 alter table t1 import tablespace;
82 check table t1 extended;
83 drop table t1;
84
85 --remove_files_wildcard $datadir/test t1*sc