Debian Codegraph @

mysql-test/suite/archive/discover.test

raw
1 -- source include/have_archive.inc
2 let $mysqld_datadir= `select @@datadir`;
3
4 create table t1 (a int) engine=archive;
5 show create table t1;
6 insert t1 values (1);
7 show tables;
8
9 --echo #
10 --echo # simple discover on use
11 --echo #
12 remove_file $mysqld_datadir/test/t1.frm;
13 flush tables;
14 insert t1 values (2);
15 select * from t1;
16 --list_files $mysqld_datadir/test
17
18 --echo #
19 --echo # show tables
20 --echo #
21 create table t2 (a int) engine=archive;
22 select * from t2;
23 remove_file $mysqld_datadir/test/t1.frm;
24 flush tables;
25 show tables;
26 --list_files $mysqld_datadir/test
27
28 --echo #
29 --echo # show full tables
30 --echo #
31 flush tables;
32 show full tables;
33 --list_files $mysqld_datadir/test
34
35 --echo #
36 --echo # discover on truncate
37 --echo #
38 flush tables;
39 --error ER_ILLEGAL_HA
40 truncate table t1;
41 --list_files $mysqld_datadir/test
42
43 --echo #
44 --echo # discover on rename
45 --echo #
46 remove_file $mysqld_datadir/test/t2.frm;
47 flush tables;
48 rename table t2 to t0;
49 --list_files $mysqld_datadir/test
50
51 --echo #
52 --echo # discover on HA_ERR_TABLE_DEF_CHANGED
53 --echo #
54 copy_file $mysqld_datadir/test/t1.ARZ $MYSQL_TMP_DIR/t1.ARZ;
55 alter table t1 modify a int default 5;
56 remove_file $mysqld_datadir/test/t1.ARZ;
57 copy_file $MYSQL_TMP_DIR/t1.ARZ $mysqld_datadir/test/t1.ARZ;
58 remove_file $MYSQL_TMP_DIR/t1.ARZ;
59 show create table t1;
60
61 --echo #
62 --echo # discover on drop
63 --echo #
64 remove_file $mysqld_datadir/test/t1.frm;
65 flush tables;
66 drop table t1;
67 --list_files $mysqld_datadir/test
68
69 --echo #
70 --echo # discover of table non-existence on drop
71 --echo #
72 select * from t0;
73 remove_file $mysqld_datadir/test/t0.ARZ;
74 flush tables;
75 drop table t0;
76 --list_files $mysqld_datadir/test
77 show status like 'Handler_discover';
78
79 --echo #
80 --echo # Bug#45377: ARCHIVE tables aren't discoverable after OPTIMIZE
81 --echo #
82
83 create table t1 (a int) engine=archive;
84 show create table t1;
85 insert into t1 values (1);
86 optimize table t1;
87 remove_file $mysqld_datadir/test/t1.frm;
88 flush tables;
89 insert into t1 values (2);
90 select * from t1 order by a;
91 show create table t1;
92 drop table t1;
93
94 --echo #
95 --echo # BUG#58205 - Valgrind failure in fn_format when called from
96 --echo # archive_discover
97 --echo #
98 create table `a/../`(a int) engine=archive;
99 select * from `a/../`; flush tables;
100 remove_file $mysqld_datadir/test/a@002f@002e@[email protected];
101 drop table `a/../`;
102
103 #
104 # MDEV-4441 DROP DATABASE with a newly created ARCHIVE table does not work
105 #
106 create database test1;
107 create table test1.t1 (i int) engine=archive;
108 drop database test1;
109
110 #
111 # MDEV-4456 Reverse discovery of ARCHIVE table on SELECT after disappearance of ARZ file
112 #
113 create table t1 (a int) engine=archive;
114 select * from t1;
115 flush tables;
116 remove_file $mysqld_datadir/test/t1.ARZ;
117 --error ER_NO_SUCH_TABLE
118 select * from t1;
119 --list_files $mysqld_datadir/test
120
121 #
122 # MDEV-4955 discover of table non-existence on CREATE
123 #
124 create table t1 (a int) engine=archive;
125 select * from t1;
126 flush tables;
127 remove_file $mysqld_datadir/test/t1.ARZ;
128 create table t1 (a int) engine=archive;
129 remove_file $mysqld_datadir/test/t1.frm;
130 flush tables;
131 --error ER_TABLE_EXISTS_ERROR
132 create table t1 (a int) engine=archive;
133 drop table t1;
134
135 #
136 # MDEV-11317: Error in deleting non existing .frm for tables with disocvery
137 #
138
139 CREATE OR REPLACE TABLE t1 ( pk INT AUTO_INCREMENT PRIMARY KEY ) ENGINE = ARCHIVE;
140 CREATE OR REPLACE TABLE t1 ( pk INT AUTO_INCREMENT PRIMARY KEY ) ENGINE = ARCHIVE;
141 DROP TABLE t1;
142 CREATE OR REPLACE TABLE t1 ( pk INT AUTO_INCREMENT PRIMARY KEY ) ENGINE = ARCHIVE;
143 SELECT * FROM t1;
144 DROP TABLE t1;