~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/rename.test

  • Committer: Stewart Smith
  • Date: 2008-11-21 16:06:07 UTC
  • mto: This revision was merged to the branch mainline in revision 593.
  • Revision ID: stewart@flamingspork.com-20081121160607-n6gdlt013spuo54r
remove mysql_frm_type
and fix engines to return correct value from delete_table when table doesn't exist.
(it should be ENOENT).

Also fix up some tests that manipulated frm files by hand. These tests are no longer valid and will need to be rewritten in the not too distant future.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
# Test of rename table
3
 
#
4
 
 
5
 
--disable_warnings
6
 
drop table if exists t0,t1,t2,t3,t4;
7
 
# Clear up from other tests (to ensure that SHOW TABLES below is right)
8
 
drop table if exists t0,t5,t6,t7,t8,t9,t1_1,t1_2,t9_1,t9_2;
9
 
--enable_warnings
10
 
 
11
 
create table t0 SELECT 1,"table 1";
12
 
create table t2 SELECT 2,"table 2";
13
 
create table t3 SELECT 3,"table 3";
14
 
rename table t0 to t1;
15
 
rename table t3 to t4, t2 to t3, t1 to t2, t4 to t1;
16
 
select * from t1;
17
 
rename table t3 to t4, t2 to t3, t1 to t2, t4 to t1;
18
 
rename table t3 to t4, t2 to t3, t1 to t2, t4 to t1;
19
 
select * from t1;
20
 
 
21
 
# The following should give errors
22
 
--error ER_TABLE_EXISTS_ERROR, ER_TABLE_EXISTS_ERROR
23
 
rename table t1 to t2;
24
 
--error ER_TABLE_EXISTS_ERROR, ER_TABLE_EXISTS_ERROR
25
 
rename table t1 to t1;
26
 
--error ER_TABLE_EXISTS_ERROR, ER_TABLE_EXISTS_ERROR
27
 
rename table t3 to t4, t2 to t3, t1 to t2, t4 to t2;
28
 
show tables like "t_";
29
 
--error ER_TABLE_EXISTS_ERROR, ER_TABLE_EXISTS_ERROR
30
 
rename table t3 to t1, t2 to t3, t1 to t2, t4 to t1;
31
 
--error ER_NO_SUCH_TABLE
32
 
rename table t3 to t4, t5 to t3, t1 to t2, t4 to t1;
33
 
 
34
 
select * from t1;
35
 
select * from t2;
36
 
select * from t3;
37
 
 
38
 
# This should give a warning for t4
39
 
drop table if exists t1,t2,t3,t4;