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
f1bbfdf4
Commit
f1bbfdf4
authored
Sep 02, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checked INTO clause during view creation (BUG#5332)
parent
31dacc6e
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
59 additions
and
30 deletions
+59
-30
include/mysqld_error.h
include/mysqld_error.h
+2
-2
mysql-test/r/view.result
mysql-test/r/view.result
+8
-0
mysql-test/t/view.test
mysql-test/t/view.test
+12
-0
sql/share/czech/errmsg.txt
sql/share/czech/errmsg.txt
+1
-1
sql/share/danish/errmsg.txt
sql/share/danish/errmsg.txt
+2
-2
sql/share/dutch/errmsg.txt
sql/share/dutch/errmsg.txt
+1
-1
sql/share/english/errmsg.txt
sql/share/english/errmsg.txt
+1
-1
sql/share/estonian/errmsg.txt
sql/share/estonian/errmsg.txt
+1
-1
sql/share/french/errmsg.txt
sql/share/french/errmsg.txt
+1
-1
sql/share/german/errmsg.txt
sql/share/german/errmsg.txt
+1
-1
sql/share/greek/errmsg.txt
sql/share/greek/errmsg.txt
+1
-1
sql/share/hungarian/errmsg.txt
sql/share/hungarian/errmsg.txt
+1
-1
sql/share/italian/errmsg.txt
sql/share/italian/errmsg.txt
+1
-1
sql/share/japanese/errmsg.txt
sql/share/japanese/errmsg.txt
+1
-1
sql/share/korean/errmsg.txt
sql/share/korean/errmsg.txt
+1
-1
sql/share/norwegian-ny/errmsg.txt
sql/share/norwegian-ny/errmsg.txt
+1
-1
sql/share/norwegian/errmsg.txt
sql/share/norwegian/errmsg.txt
+1
-1
sql/share/polish/errmsg.txt
sql/share/polish/errmsg.txt
+1
-1
sql/share/portuguese/errmsg.txt
sql/share/portuguese/errmsg.txt
+1
-1
sql/share/romanian/errmsg.txt
sql/share/romanian/errmsg.txt
+1
-1
sql/share/russian/errmsg.txt
sql/share/russian/errmsg.txt
+1
-1
sql/share/serbian/errmsg.txt
sql/share/serbian/errmsg.txt
+1
-1
sql/share/slovak/errmsg.txt
sql/share/slovak/errmsg.txt
+1
-1
sql/share/spanish/errmsg.txt
sql/share/spanish/errmsg.txt
+1
-1
sql/share/swedish/errmsg.txt
sql/share/swedish/errmsg.txt
+1
-1
sql/share/ukrainian/errmsg.txt
sql/share/ukrainian/errmsg.txt
+1
-1
sql/sql_view.cc
sql/sql_view.cc
+13
-4
No files found.
include/mysqld_error.h
View file @
f1bbfdf4
...
...
@@ -365,7 +365,7 @@
#define ER_WRONG_OBJECT 1346
#define ER_NONUPDATEABLE_COLUMN 1347
#define ER_VIEW_SELECT_DERIVED 1348
#define ER_VIEW_SELECT_
PROCEDUR
E 1349
#define ER_VIEW_SELECT_
CLAUS
E 1349
#define ER_VIEW_SELECT_VARIABLE 1350
#define ER_VIEW_SELECT_TMPTABLE 1351
#define ER_VIEW_WRONG_LIST 1352
...
...
@@ -374,4 +374,4 @@
#define ER_VIEW_INVALID 1355
#define ER_SP_NO_DROP_SP 1356
#define ER_SP_GOTO_IN_HNDLR 1357
#define ER_ERROR_MESSAGES 35
7
#define ER_ERROR_MESSAGES 35
8
mysql-test/r/view.result
View file @
f1bbfdf4
...
...
@@ -1253,3 +1253,11 @@ create view v4 as select * from v3;
select * from v4;
ERROR 21000: Subquery returns more than 1 row
drop view v4, v3, v2, v1;
create view v1 as select 5 into @w;
ERROR HY000: View's SELECT contains a 'INTO' clause
create view v1 as select 5 into outfile 'ttt';
ERROR HY000: View's SELECT contains a 'INTO' clause
create table t1 (a int);
create view v1 as select a from t1 procedure analyse();
ERROR HY000: View's SELECT contains a 'PROCEDURE' clause
drop table t1;
mysql-test/t/view.test
View file @
f1bbfdf4
...
...
@@ -1207,3 +1207,15 @@ create view v4 as select * from v3;
--
error
1242
select
*
from
v4
;
drop
view
v4
,
v3
,
v2
,
v1
;
#
# VIEW over SELECT with prohibited clauses
#
--
error
1349
create
view
v1
as
select
5
into
@
w
;
--
error
1349
create
view
v1
as
select
5
into
outfile
'ttt'
;
create
table
t1
(
a
int
);
--
error
1349
create
view
v1
as
select
a
from
t1
procedure
analyse
();
drop
table
t1
;
sql/share/czech/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -361,7 +361,7 @@ character-set=latin2
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/danish/errmsg.txt
View file @
f1bbfdf4
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
:
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */
/* Knud Riishøjgård knudriis@post.tele.dk 99 &&
...
...
@@ -355,7 +355,7 @@ character-set=latin1
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/dutch/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -363,7 +363,7 @@ character-set=latin1
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/english/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -352,7 +352,7 @@ character-set=latin1
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/estonian/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -357,7 +357,7 @@ character-set=latin7
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/french/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -352,7 +352,7 @@ character-set=latin1
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/german/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -364,7 +364,7 @@ character-set=latin1
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/greek/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -352,7 +352,7 @@ character-set=greek
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/hungarian/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -354,7 +354,7 @@ character-set=latin2
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/italian/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -352,7 +352,7 @@ character-set=latin1
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/japanese/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -354,7 +354,7 @@ character-set=ujis
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/korean/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -352,7 +352,7 @@ character-set=euckr
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/norwegian-ny/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -354,7 +354,7 @@ character-set=latin1
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/norwegian/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -354,7 +354,7 @@ character-set=latin1
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/polish/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -356,7 +356,7 @@ character-set=latin2
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/portuguese/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -353,7 +353,7 @@ character-set=latin1
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/romanian/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -356,7 +356,7 @@ character-set=latin2
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/russian/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -354,7 +354,7 @@ character-set=koi8r
"'%-.64s.%-.64s' - %s"
" '%-.64s' "
"View SELECT FROM"
"View SELECT
PROCEDURE
"
"View SELECT
'%s'
"
"View SELECT "
"View SELECT '%-.64s'"
"View SELECT view "
...
...
sql/share/serbian/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -358,7 +358,7 @@ character-set=cp1250
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/slovak/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -360,7 +360,7 @@ character-set=latin2
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/spanish/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -354,7 +354,7 @@ character-set=latin1
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/swedish/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -352,7 +352,7 @@ character-set=latin1
"'%-.64s.%-.64s' is not %s"
"Column '%-.64s' is not updatable"
"View's SELECT contains a subquery in the FROM clause"
"View's SELECT contains a
PROCEDURE
clause"
"View's SELECT contains a
'%s'
clause"
"View's SELECT contains a variable or parameter"
"View's SELECT contains a temporary table '%-.64s'"
"View's SELECT and view's field list have different column counts"
...
...
sql/share/ukrainian/errmsg.txt
View file @
f1bbfdf4
...
...
@@ -357,7 +357,7 @@ character-set=koi8u
"'%-.64s.%-.64s' %s"
" '%-.64s' "
"View SELECT Ц æ FROM"
"View SELECT æ
PROCEDURE
"
"View SELECT æ
'%s'
"
"View SELECT "
"View SELECT դ '%-.64s'"
"View SELECT ̦ æ view Ҧ ˦˦ æ"
...
...
sql/sql_view.cc
View file @
f1bbfdf4
...
...
@@ -59,12 +59,21 @@ int mysql_create_view(THD *thd,
int
res
=
0
;
DBUG_ENTER
(
"mysql_create_view"
);
if
(
lex
->
derived_tables
||
lex
->
proc_list
.
first
||
if
(
lex
->
proc_list
.
first
||
lex
->
result
)
{
my_error
(
ER_VIEW_SELECT_CLAUSE
,
MYF
(
0
),
(
lex
->
result
?
"INTO"
:
"PROCEDURE"
));
res
=
-
1
;
goto
err
;
}
if
(
lex
->
derived_tables
||
lex
->
variables_used
||
lex
->
param_list
.
elements
)
{
my_error
((
lex
->
derived_tables
?
ER_VIEW_SELECT_DERIVED
:
(
lex
->
proc_list
.
first
?
ER_VIEW_SELECT_PROCEDURE
:
ER_VIEW_SELECT_VARIABLE
)
)
,
MYF
(
0
));
my_error
((
lex
->
derived_tables
?
ER_VIEW_SELECT_DERIVED
:
ER_VIEW_SELECT_VARIABLE
),
MYF
(
0
));
res
=
-
1
;
goto
err
;
}
...
...
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