| 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; |
| 10 |
--enable_warnings |
| 11 |
|
| 12 |
--echo # |
| 13 |
--echo # Test simple create of s3 table |
| 14 |
--echo # |
| 15 |
|
| 16 |
create or replace table t1 (a int, b int, c varchar(1000), key (a), key(c)) engine=aria; |
| 17 |
insert into t1 select seq, seq+10, repeat(char(65+ mod(seq, 20)),mod(seq,1000)) from seq_1_to_10000; |
| 18 |
alter table t1 engine=s3; |
| 19 |
show create table t1; |
| 20 |
|
| 21 |
--replace_column 2 # 11 # 15 # 16 # 17 # 23 # |
| 22 |
--replace_result $database database |
| 23 |
--eval select * from information_schema.tables where table_schema="$database" and table_name="t1"; |
| 24 |
--replace_column 8 # 12 # 13 # 14 # 19 # |
| 25 |
show table status like "t1"; |
| 26 |
select a,b from t1 limit 10; |
| 27 |
select count(*) from t1; |
| 28 |
select a,b from t1 where a between 10 and 20; |
| 29 |
--replace_column 9 # |
| 30 |
explain select * from t1 where a between 10 and 20; |
| 31 |
--error ER_OPEN_AS_READONLY |
| 32 |
insert into t1 values (1,1); |
| 33 |
--error ER_OPEN_AS_READONLY |
| 34 |
update t1 set b=100 where a=1; |
| 35 |
--error ER_OPEN_AS_READONLY |
| 36 |
delete from t1 where a>10; |
| 37 |
|
| 38 |
|
| 39 |
--echo # |
| 40 |
--echo # Analyze, repair, optimize and check table |
| 41 |
--echo # |
| 42 |
|
| 43 |
set @@use_stat_tables='never'; |
| 44 |
truncate mysql.table_stats; |
| 45 |
--replace_result $database database |
| 46 |
check table t1 fast; |
| 47 |
--replace_result $database database |
| 48 |
check table t1 quick; |
| 49 |
--replace_result $database database |
| 50 |
check table t1 extended; |
| 51 |
--replace_result $database database |
| 52 |
analyze table t1; |
| 53 |
--replace_result $database database |
| 54 |
analyze table t1 persistent for all; |
| 55 |
--replace_result $database database |
| 56 |
repair table t1; |
| 57 |
--replace_result $database database |
| 58 |
optimize table t1; |
| 59 |
--replace_result $database database |
| 60 |
select * from mysql.table_stats; |
| 61 |
|
| 62 |
--echo # |
| 63 |
--echo # Converting table back to Aria |
| 64 |
--echo # |
| 65 |
|
| 66 |
alter table t1 engine=aria; |
| 67 |
show create table t1; |
| 68 |
select a,b from t1 limit 10; |
| 69 |
select count(*) from t1; |
| 70 |
delete from t1 where a=1; |
| 71 |
drop table t1; |
| 72 |
|
| 73 |
--echo # |
| 74 |
--echo # status |
| 75 |
--echo # |
| 76 |
|
| 77 |
--replace_column 2 X |
| 78 |
show variables like "s3%"; |
| 79 |
show variables like "s3_slave%"; |
| 80 |
show variables like "s3_replicate%"; |
| 81 |
|
| 82 |
--replace_column 2 X |
| 83 |
show status like "s3%"; |
| 84 |
|
| 85 |
# |
| 86 |
# clean up |
| 87 |
# |
| 88 |
--source drop_database.inc |