~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/drop.test

  • Committer: Monty Taylor
  • Date: 2009-04-14 19:16:51 UTC
  • mto: (997.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 994.
  • Revision ID: mordred@inaugust.com-20090414191651-ltbww6hpqks8k7qk
Clarified instructions in README.

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
 
83
83
# End of 4.1 tests
84
84
 
 
85
 
 
86
#
 
87
# Test for bug#21216 "Simultaneous DROP TABLE and SHOW OPEN TABLES causes
 
88
# server to crash". Crash (caused by failed assertion in 5.0 or by null
 
89
# pointer dereference in 5.1) happened when one ran SHOW OPEN TABLES
 
90
# while concurrently doing DROP TABLE (or RENAME TABLE, CREATE TABLE LIKE
 
91
# or any other command that takes name-lock) in other connection.
 
92
 
93
# Also includes test for similar bug#12212 "Crash that happens during
 
94
# removing of database name from cache" reappeared in 5.1 as bug#19403
 
95
# In its case crash happened when one concurrently executed DROP DATABASE
 
96
# and one of name-locking command.
 
97
 
98
--disable_warnings
 
99
drop database if exists mysqltest;
 
100
drop table if exists t1;
 
101
--enable_warnings
 
102
create table t1 (i int);
 
103
lock tables t1 read;
 
104
create database mysqltest;
 
105
connect (addconroot1, localhost, root,,);
 
106
--send drop table t1
 
107
connect (addconroot2, localhost, root,,);
 
108
# Server should not crash in any of the following statements
 
109
--disable_result_log
 
110
show open tables;
 
111
--enable_result_log
 
112
--send drop database mysqltest
 
113
connection default;
 
114
select 1;
 
115
unlock tables;
 
116
connection addconroot1;
 
117
--reap
 
118
connection addconroot2;
 
119
--reap
 
120
disconnect addconroot1;
 
121
disconnect addconroot2;
 
122
connection default;
 
123
 
 
124
#
 
125
# Bug#25858 Some DROP TABLE under LOCK TABLES can cause deadlocks
 
126
#
 
127
 
 
128
--disable_warnings
 
129
drop table if exists t1,t2;
 
130
--enable_warnings
 
131
create table t1 (a int);
 
132
create table t2 (a int);
 
133
lock table t1 read;
 
134
--error ER_TABLE_NOT_LOCKED
 
135
drop table t2;
 
136
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
 
137
drop table t1;
 
138
unlock tables;
 
139
drop table t1,t2;
 
140
connect (addconroot, localhost, root,,);
 
141
connection default;
 
142
create table t1 (i int);
 
143
create table t2 (i int);
 
144
lock tables t1 read;
 
145
connection addconroot;
 
146
lock tables t2 read;
 
147
--error ER_TABLE_NOT_LOCKED
 
148
drop table t1;
 
149
connection default;
 
150
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
 
151
drop table t1,t2;
 
152
disconnect addconroot;
 
153
connection default;
 
154
unlock tables;
 
155
drop table t1,t2;
 
156
 
85
157
--echo End of 5.0 tests
86
158
 
87
159
#
92
164
create table mysql_test.`#sql-347f_7` (f1 int);
93
165
create table mysql_test.`#sql-347f_8` (f1 int);
94
166
drop table mysql_test.`#sql-347f_8`;
 
167
## TODO: Uncommenting this causes drop database to fail, but I don't know that
 
168
#  I care to fix it, since it's testing .frm implementation which is being 
 
169
#  replaced.
 
170
#copy_file $MYSQLTEST_VARDIR/master-data/mysql_test/t1.frm $MYSQLTEST_VARDIR/master-data/mysql_test/#sql-347f_6.frm;
95
171
drop database mysql_test;
96
172
 
97
173
#