1drop table if exists t1;
2drop database if exists mysqltest;
3drop database if exists client_test_db;
4drop table t1;
5ERROR 42S02: Unknown table 'test.t1'
6create table t1(n int);
7insert into t1 values(1);
8create temporary table t1( n int);
9insert into t1 values(2);
10create table t1(n int);
11ERROR 42S01: Table 't1' already exists
12drop table t1;
13select * from t1;
14n
151
16create database mysqltest;
17drop database if exists mysqltest;
18create database mysqltest;
19create table mysqltest.mysqltest (n int);
20insert into mysqltest.mysqltest values (4);
21select * from mysqltest.mysqltest;
22n
234
24drop database if exists mysqltest;
25affected rows: 1
26create database mysqltest;
27use mysqltest;
28drop table table1, table2, table3, table4, table5, table6,
29table7, table8, table9, table10, table11, table12, table13,
30table14, table15, table16, table17, table18, table19, table20,
31table21, table22, table23, table24, table25, table26, table27,
32table28;
33ERROR 42S02: Unknown table 'mysqltest.table1,mysqltest.table2,mysqltest.table3,mysqltest.table4,mysqltest.table5,mysqltest.table'
34drop table table1, table2, table3, table4, table5, table6,
35table7, table8, table9, table10, table11, table12, table13,
36table14, table15, table16, table17, table18, table19, table20,
37table21, table22, table23, table24, table25, table26, table27,
38table28, table29, table30;
39ERROR 42S02: Unknown table 'mysqltest.table1,mysqltest.table2,mysqltest.table3,mysqltest.table4,mysqltest.table5,mysqltest.table'
40use test;
41drop database mysqltest;
42flush tables with read lock;
43create database mysqltest;
44Got one of the listed errors
45unlock tables;
46create database mysqltest;
47show databases;
48Database
49information_schema
50mtr
51mysql
52mysqltest
53performance_schema
54test
55flush tables with read lock;
56drop database mysqltest;
57Got one of the listed errors
58unlock tables;
59drop database mysqltest;
60show databases;
61Database
62information_schema
63mtr
64mysql
65performance_schema
66test
67drop database mysqltest;
68ERROR HY000: Can't drop database 'mysqltest'; database doesn't exist
69drop table t1;
70flush tables with read lock;
71create table t1(n int);
72ERROR HY000: Can't execute the query because you have a conflicting read lock
73unlock tables;
74create table t1(n int);
75show tables;
76Tables_in_test
77t1
78drop table t1;
79drop database if exists mysqltest;
80drop table if exists t1;
81create table t1 (i int);
82create database mysqltest;
83lock tables t1 read;
84drop table t1;
85show open tables;
86drop database mysqltest;
87select 1;
881
891
90unlock tables;
91drop table if exists t1,t2;
92create table t1 (a int);
93create table t2 (a int);
94lock table t1 read;
95drop table t2;
96ERROR HY000: Table 't2' was not locked with LOCK TABLES
97drop table t1;
98ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
99unlock tables;
100drop table t1,t2;
101create table t1 (i int);
102create table t2 (i int);
103lock tables t1 read;
104lock tables t2 read;
105drop table t1;
106ERROR HY000: Table 't1' was not locked with LOCK TABLES
107drop table t1,t2;
108ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
109unlock tables;
110drop table t1,t2;
111End of 5.0 tests
112create database mysql_test;
113create table mysql_test.t1(f1 int);
114create table mysql_test.`#sql-347f_7` (f1 int);
115create table mysql_test.`#sql-347f_8` (f1 int);
116drop table mysql_test.`#sql-347f_8`;
117drop database mysql_test;
118
119# --
120# -- Bug#29958: Weird message on DROP DATABASE if mysql.proc does not
121# -- exist.
122# --
123DROP DATABASE IF EXISTS mysql_test;
124CREATE DATABASE mysql_test;
125DROP TABLE mysql.proc;
126DROP DATABASE mysql_test;
127Warnings:
128Error	1146	Table 'mysql.proc' doesn't exist
129
130# --
131# -- End of Bug#29958.
132# --
133
134create database mysqltestbug26703;
135use mysqltestbug26703;
136create table `#mysql50#abc``def` ( id int );
137create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int);
138ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long
139create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int);
140create table `#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int);
141create table `#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int);
142ERROR 42000: Identifier name '#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long
143use test;
144drop database mysqltestbug26703;
145End of 5.1 tests
146
147# --
148# -- Bug#37431 (DROP TABLE does not report errors correctly).
149# --
150DROP TABLE IF EXISTS t1;
151DROP TABLE t1;
152ERROR 42S02: Unknown table 'test.t1'
153SHOW WARNINGS;
154Level	Code	Message
155Error	1051	Unknown table 'test.t1'
156
157# --
158# -- End of Bug#37431.
159# --
160#
161# Bug#54282 Crash in MDL_context::upgrade_shared_lock_to_exclusive
162#
163DROP TABLE IF EXISTS t1;
164CREATE TABLE t1 (a INT);
165LOCK TABLE t1 WRITE;
166DROP TABLE t1, t1;
167ERROR 42000: Not unique table/alias: 't1'
168UNLOCK TABLES;
169DROP TABLE t1;
170#
171# BUG#34750: Print database name in Unknown Table error message
172#
173
174# Test error message when droping table/view
175DROP TABLE table1;
176ERROR 42S02: Unknown table 'test.table1'
177DROP TABLE table1,table2;
178ERROR 42S02: Unknown table 'test.table1,test.table2'
179DROP VIEW view1,view2,view3,view4;
180ERROR 42S02: Unknown table 'test.view1,test.view2,test.view3,test.view4'
181
182DROP TABLE IF EXISTS table1;
183Warnings:
184Note	1051	Unknown table 'test.table1'
185DROP TABLE IF EXISTS table1,table2;
186Warnings:
187Note	1051	Unknown table 'test.table1'
188Note	1051	Unknown table 'test.table2'
189DROP VIEW IF EXISTS view1,view2,view3,view4;
190Warnings:
191Note	1051	Unknown table 'test.view1'
192Note	1051	Unknown table 'test.view2'
193Note	1051	Unknown table 'test.view3'
194Note	1051	Unknown table 'test.view4'
195
196# Test error message when trigger does not find table
197CREATE TABLE table1(a int);
198CREATE TABLE table2(b int);
199CREATE TRIGGER trg1 AFTER INSERT ON table1
200FOR EACH ROW
201INSERT INTO table2 SELECT t.notable.*;
202INSERT INTO table1 VALUES (1);
203ERROR 42S02: Unknown table 't.notable'
204DROP TABLE table1,table2;
205# End BUG#34750
206