blob: 695e405544a84f4daa9e1c5f960f657fea16cf5a (
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
|
-- source include/have_crypt.inc
#
# Test for Bug #2385 CREATE TABLE LIKE lacks locking on source and destination table
#
connect (con_to_sleep,localhost,lock_controller,,);
connect (con_to_harm_sleeper,localhost,root,,);
# locking of source:
connection con_to_sleep;
CREATE TABLE t1 (a int);
send CREATE TABLE t2 LIKE t1;
connection con_to_harm_sleeper;
sleep 1;
ALTER TABLE t1 add key(a);
connection con_to_sleep;
sleep 4;
SHOW CREATE TABLE t2;
drop table t1, t2;
# locking of destination:
connection con_to_sleep;
CREATE TABLE t1 (a int);
send CREATE TABLE t2 LIKE t1;
connection con_to_harm_sleeper;
sleep 1;
CREATE TABLE t2 (b int);
disable_query_log;
select "-----------" as "let's take a look at result of create .. like : ";
enable_query_log;
connection con_to_sleep;
sleep 1;
--error 1
reap;
disable_query_log;
select "" as "-----------";
enable_query_log;
SHOW CREATE TABLE t2;
drop table t1, t2;
|