drop.test 2.12 KB
Newer Older
1 2
# Initialise
--disable_warnings
3
drop table if exists t1;
monty@mashka.mysql.fi's avatar
monty@mashka.mysql.fi committed
4
drop database if exists mysqltest;
5 6
# If earlier test failed
drop database if exists client_test_db;
7 8
--enable_warnings

9
--error 1051
10 11 12 13 14
drop table t1;
create table t1(n int);
insert into t1 values(1);
create temporary table t1( n int);
insert into t1 values(2);
15
--error 1050
16 17 18
create table t1(n int);
drop table t1;
select * from t1;
19

20 21 22 23 24 25 26 27 28
# now test for a bug in drop database - it is important that the name
# of the table is the same as the name of the database - in the original
# code this triggered a bug
create database mysqltest;
drop database if exists mysqltest;
create database mysqltest;
create table mysqltest.mysqltest (n int);
insert into mysqltest.mysqltest values (4);
select * from mysqltest.mysqltest;
29
--enable_info
30
drop database if exists mysqltest;
31
--disable_info
32
create database mysqltest;
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54

#
# drop many tables - bug#3891
# we'll do it in mysqltest db, to be able to use longer table names
# (tableN instead on tN)
#
use mysqltest;
--error 1051
drop table table1, table2, table3, table4, table5, table6,
table7, table8, table9, table10, table11, table12, table13,
table14, table15, table16, table17, table18, table19, table20,
table21, table22, table23, table24, table25, table26, table27,
table28;

--error 1051
drop table table1, table2, table3, table4, table5, table6,
table7, table8, table9, table10, table11, table12, table13,
table14, table15, table16, table17, table18, table19, table20,
table21, table22, table23, table24, table25, table26, table27,
table28, table29, table30;

use test;
55
drop database mysqltest;
56 57

# test drop/create database and FLUSH TABLES WITH READ LOCK
58
flush tables with read lock;
59
--error 1209,1223
60
create database mysqltest;
61
unlock tables;
62
create database mysqltest;
63 64
show databases;
flush tables with read lock;
65
--error 1208,1223
66
drop database mysqltest;
67
unlock tables;
68
drop database mysqltest;
69
show databases;
70
--error 1008
71
drop database mysqltest;
72 73 74 75

# test create table and FLUSH TABLES WITH READ LOCK
drop table t1;
flush tables with read lock;
76
--error 1223
77 78 79 80 81
create table t1(n int);
unlock tables;
create table t1(n int);
show tables;
drop table t1;
82 83

# End of 4.1 tests