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
|
2006-08-21 10:18:59 +02:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Test for bug#21216 "Simultaneous DROP TABLE and SHOW OPEN TABLES causes
|
|
|
|
# server to crash". Crash (caused by failed assertion in 5.0 or by null
|
|
|
|
# pointer dereference in 5.1) happened when one ran SHOW OPEN TABLES
|
|
|
|
# while concurrently doing DROP TABLE (or RENAME TABLE, CREATE TABLE LIKE
|
|
|
|
# or any other command that takes name-lock) in other connection.
|
|
|
|
#
|
|
|
|
# Also includes test for similar bug#12212 "Crash that happens during
|
|
|
|
# removing of database name from cache" reappeared in 5.1 as bug#19403
|
|
|
|
# In its case crash happened when one concurrently executed DROP DATABASE
|
|
|
|
# and one of name-locking command.
|
|
|
|
#
|
|
|
|
--disable_warnings
|
|
|
|
drop database if exists mysqltest;
|
|
|
|
drop table if exists t1;
|
|
|
|
--enable_warnings
|
|
|
|
create table t1 (i int);
|
|
|
|
lock tables t1 read;
|
|
|
|
create database mysqltest;
|
|
|
|
connect (addconroot1, localhost, root,,);
|
|
|
|
--send drop table t1
|
|
|
|
connect (addconroot2, localhost, root,,);
|
|
|
|
# Server should not crash in any of the following statements
|
|
|
|
--disable_result_log
|
|
|
|
show open tables;
|
|
|
|
--enable_result_log
|
|
|
|
--send drop database mysqltest
|
|
|
|
connection default;
|
|
|
|
select 1;
|
|
|
|
unlock tables;
|
|
|
|
connection addconroot1;
|
|
|
|
--reap
|
|
|
|
connection addconroot2;
|
|
|
|
--reap
|
|
|
|
disconnect addconroot1;
|
|
|
|
disconnect addconroot2;
|
|
|
|
connection default;
|
|
|
|
|
|
|
|
--echo End of 5.0 tests
|