~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/rename.test

  • Committer: Brian Aker
  • Date: 2009-04-17 01:45:33 UTC
  • Revision ID: brian@gaz-20090417014533-exdrtriab9zecqs2
Refactor get_variable to session

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
show tables like "t_";
29
29
--error 1050,1050
30
30
rename table t3 to t1, t2 to t3, t1 to t2, t4 to t1;
31
 
--error 1017,1017
 
31
--error ER_NO_SUCH_TABLE
32
32
rename table t3 to t4, t5 to t3, t1 to t2, t4 to t1;
33
33
 
34
34
select * from t1;
36
36
select * from t3;
37
37
 
38
38
# This should give a warning for t4
39
 
drop table if exists t1,t2,t3,t4;
40
 
 
41
 
#
42
 
# Bug #2397 RENAME TABLES is not blocked by
43
 
# FLUSH TABLES WITH READ LOCK
44
 
#
45
 
 
46
 
connect (con1,localhost,root,,);
47
 
connect (con2,localhost,root,,);
48
 
 
49
 
connection con1;
50
 
CREATE TABLE t1 (a int);
51
 
CREATE TABLE t3 (a int);
52
 
connection con2;
53
 
FLUSH TABLES WITH READ LOCK;
54
 
connection con1;
55
 
send RENAME TABLE t1 TO t2, t3 to t4;
56
 
connection con2;
57
 
show tables;
58
 
UNLOCK TABLES;
59
 
connection con1;
60
 
reap;
61
 
connection con2;
62
 
 
63
 
# Wait for the the tables to be renamed
64
 
# i.e the query below succeds
65
 
let $query= select * from t2, t4;
66
 
source include/wait_for_query_to_suceed.inc;
67
 
 
68
 
show tables;
69
 
 
70
 
drop table t2, t4;
71
 
 
72
 
disconnect con2;
73
 
disconnect con1;
74
 
connection default;
75
 
 
76
 
 
77
 
--echo End of 4.1 tests
78
 
 
79
 
 
80
 
#
81
 
# Bug#14959: ALTER TABLE isn't able to rename a view
82
 
#
83
 
create table t1(f1 int);
84
 
create view v1 as select * from t1;
85
 
alter table v1 rename to v2;
86
 
--error 1146
87
 
alter table v1 rename to v2;
88
 
rename table v2 to v1;
89
 
--error 1050
90
 
rename table v2 to v1;
91
 
drop view v1;
92
 
drop table t1;
93
 
 
94
 
 
95
 
--echo End of 5.0 tests
 
39
drop table if exists t1,t2,t3,t4;
 
 
b'\\ No newline at end of file'