1
by brian
clean slate |
1 |
#
|
2 |
# Test for Bug #2385 CREATE TABLE LIKE lacks locking on source and destination |
|
3 |
# table |
|
4 |
#
|
|
5 |
||
6 |
--disable_warnings
|
|
7 |
drop table if exists t1,t2; |
|
8 |
--enable_warnings
|
|
9 |
||
10 |
connect (con1,localhost,root,,); |
|
11 |
connect (con2,localhost,root,,); |
|
12 |
||
13 |
# locking of source: |
|
14 |
||
15 |
CREATE TABLE t1 (x1 int); |
|
16 |
let $1= 10; |
|
17 |
while ($1) |
|
18 |
{
|
|
19 |
connection con1; |
|
20 |
send ALTER TABLE t1 CHANGE x1 x2 int; |
|
21 |
connection con2; |
|
22 |
CREATE TABLE t2 LIKE t1; |
|
23 |
replace_result x1 xx x2 xx; |
|
942.3.1
by Vladimir Kolesnikov
test generalizations |
24 |
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
|
1
by brian
clean slate |
25 |
SHOW CREATE TABLE t2; |
26 |
DROP TABLE t2; |
|
27 |
connection con1; |
|
28 |
reap; |
|
29 |
send ALTER TABLE t1 CHANGE x2 x1 int; |
|
30 |
connection con2; |
|
31 |
CREATE TABLE t2 LIKE t1; |
|
32 |
replace_result x1 xx x2 xx; |
|
942.3.1
by Vladimir Kolesnikov
test generalizations |
33 |
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
|
1
by brian
clean slate |
34 |
SHOW CREATE TABLE t2; |
35 |
DROP TABLE t2; |
|
36 |
connection con1; |
|
37 |
reap; |
|
38 |
dec $1; |
|
39 |
}
|
|
40 |
DROP TABLE t1; |
|
41 |
||
42 |
# End of 4.1 tests |