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