2003-01-06 00:48:59 +01:00
|
|
|
# Initialise
|
|
|
|
--disable_warnings
|
2001-03-27 19:23:04 +02:00
|
|
|
drop table if exists t1;
|
2003-08-18 23:08:08 +02:00
|
|
|
drop database if exists mysqltest;
|
2004-12-31 11:04:35 +01:00
|
|
|
# If earlier test failed
|
|
|
|
drop database if exists client_test_db;
|
2003-01-06 00:48:59 +01:00
|
|
|
--enable_warnings
|
|
|
|
|
2005-08-31 17:16:05 +02:00
|
|
|
--error 1051
|
2001-03-27 19:23:04 +02:00
|
|
|
drop table t1;
|
|
|
|
create table t1(n int);
|
|
|
|
insert into t1 values(1);
|
|
|
|
create temporary table t1( n int);
|
|
|
|
insert into t1 values(2);
|
2005-08-31 17:16:05 +02:00
|
|
|
--error 1050
|
2001-03-27 19:23:04 +02:00
|
|
|
create table t1(n int);
|
|
|
|
drop table t1;
|
|
|
|
select * from t1;
|
2001-06-22 00:48:18 +02:00
|
|
|
|
2001-12-22 14:13:31 +01:00
|
|
|
# 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;
|
2004-03-18 11:03:24 +01:00
|
|
|
--enable_info
|
2001-12-22 14:13:31 +01:00
|
|
|
drop database if exists mysqltest;
|
2004-03-18 11:03:24 +01:00
|
|
|
--disable_info
|
2001-12-22 14:13:31 +01:00
|
|
|
create database mysqltest;
|
2005-04-02 20:13:19 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# 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;
|
2001-12-22 14:13:31 +01:00
|
|
|
drop database mysqltest;
|
2001-06-22 00:48:18 +02:00
|
|
|
|
|
|
|
# test drop/create database and FLUSH TABLES WITH READ LOCK
|
2001-06-21 23:59:51 +02:00
|
|
|
flush tables with read lock;
|
2005-08-31 17:16:05 +02:00
|
|
|
--error 1209,1223
|
2001-12-22 14:13:31 +01:00
|
|
|
create database mysqltest;
|
2001-06-21 23:59:51 +02:00
|
|
|
unlock tables;
|
2001-12-22 14:13:31 +01:00
|
|
|
create database mysqltest;
|
2001-06-21 23:59:51 +02:00
|
|
|
show databases;
|
|
|
|
flush tables with read lock;
|
2005-08-31 17:16:05 +02:00
|
|
|
--error 1208,1223
|
2001-12-22 14:13:31 +01:00
|
|
|
drop database mysqltest;
|
2001-06-21 23:59:51 +02:00
|
|
|
unlock tables;
|
2001-12-22 14:13:31 +01:00
|
|
|
drop database mysqltest;
|
2001-06-21 23:59:51 +02:00
|
|
|
show databases;
|
2001-09-03 04:16:15 +02:00
|
|
|
--error 1008
|
2001-12-22 14:13:31 +01:00
|
|
|
drop database mysqltest;
|
2003-08-27 15:03:39 +02:00
|
|
|
|
|
|
|
# test create table and FLUSH TABLES WITH READ LOCK
|
|
|
|
drop table t1;
|
|
|
|
flush tables with read lock;
|
2005-08-31 17:16:05 +02:00
|
|
|
--error 1223
|
2003-08-27 15:03:39 +02:00
|
|
|
create table t1(n int);
|
|
|
|
unlock tables;
|
|
|
|
create table t1(n int);
|
|
|
|
show tables;
|
|
|
|
drop table t1;
|
2005-07-28 02:22:47 +02:00
|
|
|
|
|
|
|
# End of 4.1 tests
|