summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb_bugs/t/tokudb_drop_part_table_668.test
blob: d931c89769535fd641c69230e71ad32b496ae717 (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
# verify that we can drop partitioned tokudb tables created in tokudb 6.6.8

source include/have_tokudb.inc;
source include/have_partition.inc;

# capture the datadir
let $MYSQLD_DATADIR= `SELECT @@datadir`;

# shutdown mysqld (code stolen from mysql_plugin.test)
let $expect_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
# MTR will remove this file later, but this might be too late.
--error 0,1
--remove_file $expect_file
--write_file $expect_file
wait
EOF
--shutdown_server 10
--source include/wait_until_disconnected.inc

# remove all tokudb file in the datadir
system mkdir $MYSQLD_DATADIR/save;
system mv $MYSQLD_DATADIR/*toku* $MYSQLD_DATADIR/test $MYSQLD_DATADIR/save;
system mkdir $MYSQLD_DATADIR/test;

# install 6.6.8 tokudb test files
system cp -r std_data/tokudb_drop_part_table_668/data/* $MYSQLD_DATADIR;

# restart mysqld
--append_file $expect_file
restart
EOF
--enable_reconnect
--source include/wait_until_connected_again.inc

create table tc (a int, b int, c int, primary key(a), key(b)) partition by hash(a) partitions 2;

# check that the tokudb meta data gets dropped when the table is dropped
select dictionary_name from information_schema.tokudb_file_map;
drop table ta;
select dictionary_name from information_schema.tokudb_file_map;
drop table tc;
select dictionary_name from information_schema.tokudb_file_map;

# check that the test dir is empty
list_files $MYSQLD_DATADIR/test *.frm;

# shutdown mysqld (code stolen from mysql_plugin.test)
let $expect_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
# MTR will remove this file later, but this might be too late.
--error 0,1
--remove_file $expect_file
--write_file $expect_file
wait
EOF
--shutdown_server 10
--source include/wait_until_disconnected.inc

# restore saved datadir
system rm -rf $MYSQLD_DATADIR/*toku* $MYSQLD_DATADIR/test;
system mv $MYSQLD_DATADIR/save/* $MYSQLD_DATADIR;
system rmdir $MYSQLD_DATADIR/save;

# restart mysqld
--append_file $expect_file
restart
EOF
--enable_reconnect
--source include/wait_until_connected_again.inc