2
# The server need to be started in $MYSQLTEST_VARDIR since it
4
--source include/uses_vardir.inc
6
# Save the initial number of concurrent sessions
7
--source include/count_sessions.inc
10
# This test is a bit tricky as we can't use backup table to overwrite an old
13
connect (con1,localhost,root,,);
14
connect (con2,localhost,root,,);
18
drop table if exists t1, t2, t3, t4;
20
create table t4(n int);
21
--replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
22
backup table t4 to '../../bogus';
23
backup table t4 to '../../tmp';
24
--replace_result ": 7" ": X" ": 17" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
25
backup table t4 to '../../tmp';
27
restore table t4 from '../../tmp';
28
select count(*) from t4;
30
create table t1(n int);
31
insert into t1 values (23),(45),(67);
32
backup table t1 to '../../tmp';
34
--replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
35
restore table t1 from '../../bogus';
36
restore table t1 from '../../tmp';
38
create table t2(m int not null primary key);
39
create table t3(k int not null primary key);
40
insert into t2 values (123),(145),(167);
41
insert into t3 values (223),(245),(267);
42
backup table t2,t3 to '../../tmp';
44
restore table t1,t2,t3 from '../../tmp';
48
drop table t1,t2,t3,t4;
49
restore table t1 from '../../tmp';
51
rename table t1 to t5;
56
backup table t5 to '../../tmp';
66
remove_file $MYSQLTEST_VARDIR/tmp/t1.MYD;
67
remove_file $MYSQLTEST_VARDIR/tmp/t2.MYD;
68
remove_file $MYSQLTEST_VARDIR/tmp/t3.MYD;
69
remove_file $MYSQLTEST_VARDIR/tmp/t4.MYD;
70
remove_file $MYSQLTEST_VARDIR/tmp/t5.MYD;
71
remove_file $MYSQLTEST_VARDIR/tmp/t1.frm;
72
remove_file $MYSQLTEST_VARDIR/tmp/t2.frm;
73
remove_file $MYSQLTEST_VARDIR/tmp/t3.frm;
74
remove_file $MYSQLTEST_VARDIR/tmp/t4.frm;
75
remove_file $MYSQLTEST_VARDIR/tmp/t5.frm;
82
# Bug#18775 - Temporary table from alter table visible to other threads
84
# Backup did not encode table names.
86
DROP TABLE IF EXISTS `t+1`;
88
CREATE TABLE `t+1` (c1 INT);
89
INSERT INTO `t+1` VALUES (1), (2), (3);
90
BACKUP TABLE `t+1` TO '../../tmp';
94
RESTORE TABLE `t+1` FROM '../../tmp';
98
remove_file $MYSQLTEST_VARDIR/tmp/t@002b1.frm;
99
remove_file $MYSQLTEST_VARDIR/tmp/t@002b1.MYD;
102
# Wait till all disconnects are completed
103
--source include/wait_until_count_sessions.inc