1
by brian
clean slate |
1 |
# Initialise |
2 |
--disable_warnings
|
|
3 |
drop table if exists t1; |
|
4 |
drop database if exists mysqltest; |
|
5 |
# If earlier test failed |
|
6 |
drop database if exists client_test_db; |
|
7 |
--enable_warnings
|
|
8 |
||
1731.3.1
by Lee Bieber
change tests to use enum values instead of error numbers |
9 |
--error ER_BAD_TABLE_ERROR
|
1
by brian
clean slate |
10 |
drop table t1; |
11 |
create table t1(n int); |
|
12 |
insert into t1 values(1); |
|
13 |
create temporary table t1( n int); |
|
14 |
insert into t1 values(2); |
|
1731.3.1
by Lee Bieber
change tests to use enum values instead of error numbers |
15 |
--error ER_TABLE_EXISTS_ERROR
|
1
by brian
clean slate |
16 |
create table t1(n int); |
17 |
drop table t1; |
|
18 |
select * from t1; |
|
19 |
||
20 |
# now test for a bug in drop database - it is important that the name |
|
21 |
# of the table is the same as the name of the database - in the original |
|
22 |
# code this triggered a bug |
|
23 |
create database mysqltest; |
|
24 |
drop database if exists mysqltest; |
|
25 |
create database mysqltest; |
|
26 |
create table mysqltest.mysqltest (n int); |
|
27 |
insert into mysqltest.mysqltest values (4); |
|
28 |
select * from mysqltest.mysqltest; |
|
29 |
--enable_info
|
|
30 |
drop database if exists mysqltest; |
|
31 |
--disable_info
|
|
32 |
create database mysqltest; |
|
33 |
||
34 |
#
|
|
35 |
# drop many tables - bug#3891 |
|
36 |
# we'll do it in mysqltest db, to be able to use longer table names |
|
37 |
# (tableN instead on tN) |
|
38 |
#
|
|
39 |
use mysqltest; |
|
1731.3.1
by Lee Bieber
change tests to use enum values instead of error numbers |
40 |
--error ER_BAD_TABLE_ERROR
|
1
by brian
clean slate |
41 |
drop table table1, table2, table3, table4, table5, table6, |
42 |
table7, table8, table9, table10, table11, table12, table13, |
|
43 |
table14, table15, table16, table17, table18, table19, table20, |
|
44 |
table21, table22, table23, table24, table25, table26, table27, |
|
45 |
table28; |
|
46 |
||
1731.3.1
by Lee Bieber
change tests to use enum values instead of error numbers |
47 |
--error ER_BAD_TABLE_ERROR
|
1
by brian
clean slate |
48 |
drop table table1, table2, table3, table4, table5, table6, |
49 |
table7, table8, table9, table10, table11, table12, table13, |
|
50 |
table14, table15, table16, table17, table18, table19, table20, |
|
51 |
table21, table22, table23, table24, table25, table26, table27, |
|
52 |
table28, table29, table30; |
|
53 |
||
54 |
use test; |
|
55 |
drop database mysqltest; |
|
56 |
||
57 |
# test drop/create database and FLUSH TABLES WITH READ LOCK |
|
58 |
flush tables with read lock; |
|
1731.3.1
by Lee Bieber
change tests to use enum values instead of error numbers |
59 |
--error ER_DROP_DB_WITH_READ_LOCK, ER_CANT_UPDATE_WITH_READLOCK
|
1
by brian
clean slate |
60 |
create database mysqltest; |
61 |
unlock tables; |
|
62 |
create database mysqltest; |
|
63 |
show databases; |
|
64 |
flush tables with read lock; |
|
1731.3.1
by Lee Bieber
change tests to use enum values instead of error numbers |
65 |
--error ER_DROP_DB_WITH_READ_LOCK, ER_CANT_UPDATE_WITH_READLOCK
|
1
by brian
clean slate |
66 |
drop database mysqltest; |
67 |
unlock tables; |
|
68 |
drop database mysqltest; |
|
69 |
show databases; |
|
1731.3.1
by Lee Bieber
change tests to use enum values instead of error numbers |
70 |
--error ER_DB_DROP_EXISTS
|
1
by brian
clean slate |
71 |
drop database mysqltest; |
72 |
||
73 |
# test create table and FLUSH TABLES WITH READ LOCK |
|
74 |
drop table t1; |
|
75 |
flush tables with read lock; |
|
1731.3.1
by Lee Bieber
change tests to use enum values instead of error numbers |
76 |
--error ER_CANT_UPDATE_WITH_READLOCK
|
1
by brian
clean slate |
77 |
create table t1(n int); |
78 |
unlock tables; |
|
79 |
create table t1(n int); |
|
80 |
show tables; |
|
81 |
drop table t1; |
|
82 |
||
83 |
# End of 4.1 tests |
|
84 |
||
85 |
--echo End of 5.0 tests
|
|
86 |
||
87 |
#
|
|
88 |
# Bug#30152 MySQLD crash duing alter table causes DROP DATABASE to FAIL due to temp file |
|
89 |
#
|
|
90 |
create database mysql_test; |
|
91 |
create table mysql_test.t1(f1 int); |
|
92 |
create table mysql_test.`#sql-347f_7` (f1 int); |
|
93 |
create table mysql_test.`#sql-347f_8` (f1 int); |
|
94 |
drop table mysql_test.`#sql-347f_8`; |
|
95 |
drop database mysql_test; |
|
96 |
||
97 |
#
|
|
98 |
# Bug#26703: DROP DATABASE fails if database contains a #mysql50# table with backticks |
|
99 |
#
|
|
100 |
create database mysqltestbug26703; |
|
101 |
use mysqltestbug26703; |
|
102 |
create table `#mysql50#abc``def` ( id int ); |
|
103 |
--error ER_WRONG_TABLE_NAME
|
|
104 |
create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int); |
|
105 |
create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int); |
|
106 |
create table `#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int); |
|
107 |
--error ER_WRONG_TABLE_NAME
|
|
108 |
create table `#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int); |
|
109 |
use test; |
|
110 |
drop database mysqltestbug26703; |
|
111 |
||
112 |
###########################################################################
|
|
113 |
||
114 |
--echo
|
|
115 |
--echo End of 5.1 tests
|