Skip to content

Commit 346d10a

Browse files
committed
Fixed error messages from DROP VIEW to align with DROP TABLE
- Produce a "Note" for all wrongly dropped objects (Like doing DROP VIEW on a table). - IF EXISTS ends with a list of all not existing objects, instead of a separate note for every not existing object. Other things: - Fixed bug where one could do CREATE TEMPORARY SEQUENCE multiple times and create multiple temporary sequences with the same name.
1 parent 5bcb1d6 commit 346d10a

File tree

8 files changed

+1150
-37
lines changed

8 files changed

+1150
-37
lines changed

mysql-test/main/create_drop_view.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@ Warnings:
6161
Note 4092 Unknown VIEW: 'test.v1'
6262
DROP VIEW IF EXISTS t1;
6363
Warnings:
64+
Warning 1347 'test.t1' is not of type 'VIEW'
6465
Note 4092 Unknown VIEW: 'test.t1'
6566
DROP TABLE t1;

mysql-test/main/drop.result

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,7 @@ Note 1051 Unknown table 'test.table1'
209209
Note 1051 Unknown table 'test.table2'
210210
DROP VIEW IF EXISTS view1,view2,view3,view4;
211211
Warnings:
212-
Note 4092 Unknown VIEW: 'test.view1'
213-
Note 4092 Unknown VIEW: 'test.view2'
214-
Note 4092 Unknown VIEW: 'test.view3'
215-
Note 4092 Unknown VIEW: 'test.view4'
212+
Note 4092 Unknown VIEW: 'test.view1,test.view2,test.view3,test.view4'
216213

217214
# Test error message when trigger does not find table
218215
CREATE TABLE table1(a int);

mysql-test/main/drop_combinations.inc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# Create all tables, sequences and views needed for drop combinations;
3+
#
4+
5+
if ($create_option != 'temporary')
6+
{
7+
show tables;
8+
}
9+
10+
--echo # Generating test tables
11+
--disable_query_log
12+
--disable_warnings
13+
eval create $create_option table if not exists t1 (a int);
14+
eval create $create_option table if not exists t2 (a int);
15+
eval create $create_option sequence if not exists s1;
16+
eval create $create_option sequence if not exists s2;
17+
if ($create_option != 'temporary')
18+
{
19+
eval create view if not exists v1 as SELECT * from t1;
20+
eval create view if not exists v2 as SELECT * from t2;
21+
}
22+
23+
--enable_warnings
24+
--enable_query_log

0 commit comments

Comments
 (0)