Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
470c3fd9
Commit
470c3fd9
authored
Mar 26, 2017
by
Monty
Committed by
Alexander Barkov
Apr 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change error message when using DROP VIEW on a non existing view from
"Unknown table" to "Unknown view"
parent
17a87d60
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
49 additions
and
49 deletions
+49
-49
mysql-test/r/create_drop_binlog.result
mysql-test/r/create_drop_binlog.result
+1
-1
mysql-test/r/create_drop_view.result
mysql-test/r/create_drop_view.result
+1
-1
mysql-test/r/drop.result
mysql-test/r/drop.result
+5
-5
mysql-test/r/grant.result
mysql-test/r/grant.result
+1
-1
mysql-test/r/profiling.result
mysql-test/r/profiling.result
+1
-1
mysql-test/r/sp-group.result
mysql-test/r/sp-group.result
+1
-1
mysql-test/r/sp.result
mysql-test/r/sp.result
+1
-1
mysql-test/r/view.result
mysql-test/r/view.result
+3
-3
mysql-test/suite/funcs_1/r/innodb_views.result
mysql-test/suite/funcs_1/r/innodb_views.result
+10
-10
mysql-test/suite/funcs_1/r/memory_views.result
mysql-test/suite/funcs_1/r/memory_views.result
+10
-10
mysql-test/suite/funcs_1/views/views_master.inc
mysql-test/suite/funcs_1/views/views_master.inc
+2
-2
mysql-test/suite/rpl/r/rpl_create_drop_view.result
mysql-test/suite/rpl/r/rpl_create_drop_view.result
+2
-2
mysql-test/suite/rpl/r/rpl_drop_view.result
mysql-test/suite/rpl/r/rpl_drop_view.result
+2
-2
mysql-test/suite/rpl/t/rpl_create_drop_view.test
mysql-test/suite/rpl/t/rpl_create_drop_view.test
+1
-1
mysql-test/suite/rpl/t/rpl_drop_view.test
mysql-test/suite/rpl/t/rpl_drop_view.test
+2
-2
mysql-test/t/drop.test
mysql-test/t/drop.test
+1
-1
mysql-test/t/view.test
mysql-test/t/view.test
+2
-2
sql/sql_view.cc
sql/sql_view.cc
+3
-3
No files found.
mysql-test/r/create_drop_binlog.result
View file @
470c3fd9
...
...
@@ -160,7 +160,7 @@ Note 1050 Table 'v1' already exists
DROP VIEW IF EXISTS v1;
DROP VIEW IF EXISTS v1;
Warnings:
Note
1051 Unknown table
'test.v1'
Note
4067 Unknown VIEW:
'test.v1'
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
# # Format_desc 1 # VER
...
...
mysql-test/r/create_drop_view.result
View file @
470c3fd9
...
...
@@ -55,5 +55,5 @@ id
DROP VIEW IF EXISTS v1;
DROP VIEW IF EXISTS v1;
Warnings:
Note
1051 Unknown table
'test.v1'
Note
4067 Unknown VIEW:
'test.v1'
DROP TABLE t1;
mysql-test/r/drop.result
View file @
470c3fd9
...
...
@@ -198,7 +198,7 @@ ERROR 42S02: Unknown table 'test.table1'
DROP TABLE table1,table2;
ERROR 42S02: Unknown table 'test.table1,test.table2'
DROP VIEW view1,view2,view3,view4;
ERROR 42S02: Unknown
table
'test.view1,test.view2,test.view3,test.view4'
ERROR 42S02: Unknown
VIEW:
'test.view1,test.view2,test.view3,test.view4'
DROP TABLE IF EXISTS table1;
Warnings:
...
...
@@ -209,10 +209,10 @@ Note 1051 Unknown table 'test.table1'
Note 1051 Unknown table 'test.table2'
DROP VIEW IF EXISTS view1,view2,view3,view4;
Warnings:
Note
1051 Unknown table
'test.view1'
Note
1051 Unknown table
'test.view2'
Note
1051 Unknown table
'test.view3'
Note
1051 Unknown table
'test.view4'
Note
4067 Unknown VIEW:
'test.view1'
Note
4067 Unknown VIEW:
'test.view2'
Note
4067 Unknown VIEW:
'test.view3'
Note
4067 Unknown VIEW:
'test.view4'
# Test error message when trigger does not find table
CREATE TABLE table1(a int);
...
...
mysql-test/r/grant.result
View file @
470c3fd9
...
...
@@ -1428,7 +1428,7 @@ Warnings:
Note 1305 FUNCTION test.test_function does not exist
drop view if exists v1;
Warnings:
Note
1051 Unknown table
'test.v1'
Note
4067 Unknown VIEW:
'test.v1'
create table test (col1 varchar(30));
create function test_function() returns varchar(30)
begin
...
...
mysql-test/r/profiling.result
View file @
470c3fd9
...
...
@@ -415,7 +415,7 @@ select @@profiling;
drop table if exists t1, t2, t3;
drop view if exists v1;
Warnings:
Note
1051 Unknown table
'test.v1'
Note
4067 Unknown VIEW:
'test.v1'
drop function if exists f1;
set session profiling = OFF;
set global profiling_history_size= @start_value;
...
...
mysql-test/r/sp-group.result
View file @
470c3fd9
...
...
@@ -3,7 +3,7 @@ Warnings:
Note 1051 Unknown table 'test.t1'
drop view if exists view_t1;
Warnings:
Note
1051 Unknown table
'test.view_t1'
Note
4067 Unknown VIEW:
'test.view_t1'
SET sql_mode=ONLY_FULL_GROUP_BY;
CREATE TABLE t1 (
pk INT,
...
...
mysql-test/r/sp.result
View file @
470c3fd9
...
...
@@ -3211,7 +3211,7 @@ drop procedure bug10961|
DROP PROCEDURE IF EXISTS bug6866|
DROP VIEW IF EXISTS tv|
Warnings:
Note
1051 Unknown table
'test.tv'
Note
4067 Unknown VIEW:
'test.tv'
DROP TABLE IF EXISTS tt1,tt2,tt3|
Warnings:
Note 1051 Unknown table 'test.tt1'
...
...
mysql-test/r/view.result
View file @
470c3fd9
...
...
@@ -197,7 +197,7 @@ c d
2 5
3 10
drop view v100;
ERROR 42S02: Unknown
table
'test.v100'
ERROR 42S02: Unknown
VIEW:
'test.v100'
drop view t1;
ERROR HY000: 'test.t1' is not VIEW
drop table v1;
...
...
@@ -2894,7 +2894,7 @@ Tables_in_test
t1
v1
DROP VIEW v2,v1;
ERROR 42S02: Unknown
table
'test.v2'
ERROR 42S02: Unknown
VIEW:
'test.v2'
SHOW TABLES;
Tables_in_test
t1
...
...
@@ -5222,7 +5222,7 @@ CREATE TABLE t4 (i4 INT);
INSERT INTO t4 VALUES (1),(2);
DROP VIEW IF EXISTS v1;
Warnings:
Note
1051 Unknown table
'test.v1'
Note
4067 Unknown VIEW:
'test.v1'
CREATE VIEW v1 AS select coalesce(j1,i3) AS v1_field1 from t2 join t3 left join t1 on ( i1 = i2 );
CREATE VIEW v2 AS select v1_field1 from t4 join v1;
prepare my_stmt from "select v1_field1 from v2";
...
...
mysql-test/suite/funcs_1/r/innodb_views.result
View file @
470c3fd9
...
...
@@ -4314,7 +4314,7 @@ CREATE VIEW v2 AS Select * from test.v1;
ERROR 42S02: Table 'test.v1' doesn't exist
DROP VIEW IF EXISTS v2;
Warnings:
Note
1051 Unknown table
'test.v2'
Note
4067 Unknown VIEW:
'test.v2'
Testcase 3.3.1.25
--------------------------------------------------------------------------------
...
...
@@ -7566,7 +7566,7 @@ Call sp1() ;
ERROR 42000: PROCEDURE test.sp1 does not exist
Drop view if exists test.v1 ;
Warnings:
Note
1051 Unknown table
'test.v1'
Note
4067 Unknown VIEW:
'test.v1'
Drop procedure sp1 ;
ERROR 42000: PROCEDURE test.sp1 does not exist
...
...
@@ -21307,12 +21307,12 @@ CREATE TABLE t1 ( f1 VARCHAR(1000) ) ENGINE = innodb ;
CREATE VIEW v1 AS SELECT f1 FROM t1;
DROP VIEW v1;
DROP VIEW v1;
ERROR 42S02: Unknown
table
'test.v1'
ERROR 42S02: Unknown
VIEW:
'test.v1'
CREATE VIEW v1 AS SELECT f1 FROM t1;
DROP VIEW IF EXISTS v1;
DROP VIEW IF EXISTS v1;
Warnings:
Note
1051 Unknown table
'test.v1'
Note
4067 Unknown VIEW:
'test.v1'
Testcase 3.3.1.68
--------------------------------------------------------------------------------
...
...
@@ -21324,31 +21324,31 @@ CREATE VIEW v1_base AS SELECT * FROM t1;
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_top ;
DROP VIEW v1_top;
ERROR 42S02: Unknown
table
'test.v1_top'
ERROR 42S02: Unknown
VIEW:
'test.v1_top'
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_base ;
DROP VIEW v1_base;
ERROR 42S02: Unknown
table
'test.v1_base'
ERROR 42S02: Unknown
VIEW:
'test.v1_base'
DROP VIEW v1_top;
CREATE VIEW v1_base AS SELECT * FROM t1;
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_top CASCADE ;
DROP VIEW v1_top;
ERROR 42S02: Unknown
table
'test.v1_top'
ERROR 42S02: Unknown
VIEW:
'test.v1_top'
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_base CASCADE ;
DROP VIEW v1_base;
ERROR 42S02: Unknown
table
'test.v1_base'
ERROR 42S02: Unknown
VIEW:
'test.v1_base'
DROP VIEW v1_top;
CREATE VIEW v1_base AS SELECT * FROM t1;
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_top RESTRICT ;
DROP VIEW v1_top;
ERROR 42S02: Unknown
table
'test.v1_top'
ERROR 42S02: Unknown
VIEW:
'test.v1_top'
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_base RESTRICT ;
DROP VIEW v1_base;
ERROR 42S02: Unknown
table
'test.v1_base'
ERROR 42S02: Unknown
VIEW:
'test.v1_base'
DROP VIEW v1_top;
Testcase 3.3.1.69, 3.3.1.70, 3.3.1.A5
...
...
mysql-test/suite/funcs_1/r/memory_views.result
View file @
470c3fd9
...
...
@@ -4315,7 +4315,7 @@ CREATE VIEW v2 AS Select * from test.v1;
ERROR 42S02: Table 'test.v1' doesn't exist
DROP VIEW IF EXISTS v2;
Warnings:
Note
1051 Unknown table
'test.v2'
Note
4067 Unknown VIEW:
'test.v2'
Testcase 3.3.1.25
--------------------------------------------------------------------------------
...
...
@@ -7567,7 +7567,7 @@ Call sp1() ;
ERROR 42000: PROCEDURE test.sp1 does not exist
Drop view if exists test.v1 ;
Warnings:
Note
1051 Unknown table
'test.v1'
Note
4067 Unknown VIEW:
'test.v1'
Drop procedure sp1 ;
ERROR 42000: PROCEDURE test.sp1 does not exist
...
...
@@ -21309,12 +21309,12 @@ CREATE TABLE t1 ( f1 VARCHAR(1000) ) ENGINE = memory ;
CREATE VIEW v1 AS SELECT f1 FROM t1;
DROP VIEW v1;
DROP VIEW v1;
ERROR 42S02: Unknown
table
'test.v1'
ERROR 42S02: Unknown
VIEW:
'test.v1'
CREATE VIEW v1 AS SELECT f1 FROM t1;
DROP VIEW IF EXISTS v1;
DROP VIEW IF EXISTS v1;
Warnings:
Note
1051 Unknown table
'test.v1'
Note
4067 Unknown VIEW:
'test.v1'
Testcase 3.3.1.68
--------------------------------------------------------------------------------
...
...
@@ -21326,31 +21326,31 @@ CREATE VIEW v1_base AS SELECT * FROM t1;
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_top ;
DROP VIEW v1_top;
ERROR 42S02: Unknown
table
'test.v1_top'
ERROR 42S02: Unknown
VIEW:
'test.v1_top'
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_base ;
DROP VIEW v1_base;
ERROR 42S02: Unknown
table
'test.v1_base'
ERROR 42S02: Unknown
VIEW:
'test.v1_base'
DROP VIEW v1_top;
CREATE VIEW v1_base AS SELECT * FROM t1;
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_top CASCADE ;
DROP VIEW v1_top;
ERROR 42S02: Unknown
table
'test.v1_top'
ERROR 42S02: Unknown
VIEW:
'test.v1_top'
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_base CASCADE ;
DROP VIEW v1_base;
ERROR 42S02: Unknown
table
'test.v1_base'
ERROR 42S02: Unknown
VIEW:
'test.v1_base'
DROP VIEW v1_top;
CREATE VIEW v1_base AS SELECT * FROM t1;
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_top RESTRICT ;
DROP VIEW v1_top;
ERROR 42S02: Unknown
table
'test.v1_top'
ERROR 42S02: Unknown
VIEW:
'test.v1_top'
CREATE VIEW v1_top AS SELECT * FROM v1_base;
DROP VIEW v1_base RESTRICT ;
DROP VIEW v1_base;
ERROR 42S02: Unknown
table
'test.v1_base'
ERROR 42S02: Unknown
VIEW:
'test.v1_base'
DROP VIEW v1_top;
Testcase 3.3.1.69, 3.3.1.70, 3.3.1.A5
...
...
mysql-test/suite/funcs_1/views/views_master.inc
View file @
470c3fd9
...
...
@@ -2745,7 +2745,7 @@ CREATE VIEW v1 AS SELECT f1 FROM t1;
# DROP VIEW
DROP
VIEW
v1
;
--
error
ER_
BAD_TABLE_ERROR
--
error
ER_
UNKNOWN_VIEW
DROP
VIEW
v1
;
CREATE
VIEW
v1
AS
SELECT
f1
FROM
t1
;
...
...
@@ -2792,7 +2792,7 @@ while ($num1)
# DROP VIEW v1_top < |RESTRICD|CASCADE> must be successful.
eval
$aux1
;
# Check, that v1_top really no more exists + cleanup for the second sub test
--
error
ER_
BAD_TABLE_ERROR
--
error
ER_
UNKNOWN_VIEW
DROP
VIEW
v1_top
;
CREATE
VIEW
v1_top
AS
SELECT
*
FROM
v1_base
;
...
...
mysql-test/suite/rpl/r/rpl_create_drop_view.result
View file @
470c3fd9
...
...
@@ -96,10 +96,10 @@ connection master;
DROP VIEW v1;
DROP TABLE t1;
DROP VIEW v1;
ERROR 42S02: Unknown
table
'test.v1'
ERROR 42S02: Unknown
VIEW:
'test.v1'
DROP VIEW IF EXISTS v2;
Warnings:
Note
1051 Unknown table
'test.v2'
Note
4067 Unknown VIEW:
'test.v2'
# Syncing slave with master
connection slave;
SELECT * FROM v1;
...
...
mysql-test/suite/rpl/r/rpl_drop_view.result
View file @
470c3fd9
...
...
@@ -9,9 +9,9 @@ create view v1 as select * from t1;
create view v2 as select * from t2;
create view v3 as select * from t3;
drop view not_exist_view;
ERROR 42S02: Unknown
table
'test.not_exist_view'
ERROR 42S02: Unknown
VIEW:
'test.not_exist_view'
drop view v1, not_exist_view;
ERROR 42S02: Unknown
table
'test.not_exist_view'
ERROR 42S02: Unknown
VIEW:
'test.not_exist_view'
select * from v1;
ERROR 42S02: Table 'test.v1' doesn't exist
drop view v2, v3;
...
...
mysql-test/suite/rpl/t/rpl_create_drop_view.test
View file @
470c3fd9
...
...
@@ -41,7 +41,7 @@ connection master;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
--
error
ER_
BAD_TABLE_ERROR
--
error
ER_
UNKNOWN_VIEW
DROP
VIEW
v1
;
DROP
VIEW
IF
EXISTS
v2
;
...
...
mysql-test/suite/rpl/t/rpl_drop_view.test
View file @
470c3fd9
...
...
@@ -13,9 +13,9 @@ create table t3 (c int);
create
view
v1
as
select
*
from
t1
;
create
view
v2
as
select
*
from
t2
;
create
view
v3
as
select
*
from
t3
;
--
error
1051
--
error
ER_UNKNOWN_VIEW
drop
view
not_exist_view
;
--
error
1051
--
error
ER_UNKNOWN_VIEW
drop
view
v1
,
not_exist_view
;
--
error
1146
select
*
from
v1
;
...
...
mysql-test/t/drop.test
View file @
470c3fd9
...
...
@@ -288,7 +288,7 @@ DROP TABLE t1;
DROP
TABLE
table1
;
--
error
ER_BAD_TABLE_ERROR
DROP
TABLE
table1
,
table2
;
--
error
ER_
BAD_TABLE_ERROR
--
error
ER_
UNKNOWN_VIEW
DROP
VIEW
view1
,
view2
,
view3
,
view4
;
--
echo
DROP
TABLE
IF
EXISTS
table1
;
...
...
mysql-test/t/view.test
View file @
470c3fd9
...
...
@@ -125,7 +125,7 @@ select * from v1;
select
*
from
v2
;
# try to drop nonexistent VIEW
--
error
ER_BAD_TABLE_ERROR
--
error
ER_UNKNOWN_VIEW
drop
view
v100
;
# try to drop table with DROP VIEW
...
...
@@ -2782,7 +2782,7 @@ CREATE TABLE t1 (id INT);
CREATE
VIEW
v1
AS
SELECT
id
FROM
t1
;
SHOW
TABLES
;
--
error
ER_
BAD_TABLE_ERROR
--
error
ER_
UNKNOWN_VIEW
DROP
VIEW
v2
,
v1
;
SHOW
TABLES
;
...
...
sql/sql_view.cc
View file @
470c3fd9
...
...
@@ -1805,8 +1805,8 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode)
if
(
thd
->
lex
->
if_exists
())
{
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_NOTE
,
ER_
BAD_TABLE_ERROR
,
ER_THD
(
thd
,
ER_
BAD_TABLE_ERROR
),
ER_
UNKNOWN_VIEW
,
ER_THD
(
thd
,
ER_
UNKNOWN_VIEW
),
name
);
continue
;
}
...
...
@@ -1848,7 +1848,7 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode)
}
if
(
non_existant_views
.
length
())
{
my_error
(
ER_
BAD_TABLE_ERROR
,
MYF
(
0
),
non_existant_views
.
c_ptr_safe
());
my_error
(
ER_
UNKNOWN_VIEW
,
MYF
(
0
),
non_existant_views
.
c_ptr_safe
());
}
something_wrong
=
error
||
wrong_object_name
||
non_existant_views
.
length
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment