Debian Codegraph @

mysql-test/suite/s3/discovery.test

raw
1 --source include/have_s3.inc
2 --source include/have_sequence.inc
3
4 #
5 # Create unique database for running the tests
6 #
7 --source create_database.inc
8 --disable_warnings
9 drop table if exists t1,t2;
10 --enable_warnings
11
12 let $datadir=`select @@datadir`;
13
14 --echo #
15 --echo # Test discovery of s3
16 --echo #
17
18 create table t1 (a int, b int) engine=aria select seq as a, seq+10 as b from seq_1_to_10;
19 alter table t1 engine=s3;
20
21 --echo #
22 --echo # Check discovery by select
23 --echo #
24
25 --remove_file $datadir/$database/t1.frm
26 flush tables;
27 select * from t1 limit 1;
28
29 --echo #
30 --echo # Check if changes to .frm is copied to S3
31 --echo #
32
33 alter table t1 change column b c int not null;
34 flush tables;
35 --remove_file $datadir/$database/t1.frm
36 select * from t1 limit 1;
37
38 --echo #
39 --echo # Check if SHOW TABLES finds the S3 tables
40 --echo #
41
42 create table t2 (a int, b int) engine=aria select seq as a, seq+10 as b from seq_1_to_10;
43 alter table t2 engine=s3;
44
45 flush tables;
46 --remove_file $datadir/$database/t1.frm
47 --replace_result $database database
48 SHOW TABLES;
49 drop table t2;
50
51 --echo #
52 --echo # Check if DROP TABLE works with discovery
53 --echo #
54
55 select count(*) from t1;
56 flush tables;
57 --remove_file $datadir/$database/t1.frm
58 drop table t1;
59 --replace_result $database database
60 --error ER_NO_SUCH_TABLE
61 select count(*), sum(a) from t1;
62
63 --echo #
64 --echo # Check if S3 detects that the .frm is too old
65 --echo #
66
67 create table t1 (a int, b int) engine=aria select seq as a, seq+10 as b from seq_1_to_10;
68 alter table t1 engine=s3;
69 --copy_file $datadir/$database/t1.frm $datadir/$database/t1.frm-old
70 alter table t1 add column c int, engine=s3;
71 flush tables;
72 --remove_file $datadir/$database/t1.frm
73 --copy_file $datadir/$database/t1.frm-old $datadir/$database/t1.frm
74 --remove_file $datadir/$database/t1.frm-old
75 select * from t1 limit 1;
76 flush tables;
77 --remove_file $datadir/$database/t1.frm
78 select * from t1 limit 1;
79 drop table t1;
80
81 #
82 # clean up
83 #
84 --source drop_database.inc