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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
5963573c
Commit
5963573c
authored
Aug 25, 2005
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Plain Diff
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-bug1-5.0
parents
469e413f
7f48830f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
5 deletions
+36
-5
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/sql_view.cc
sql/sql_view.cc
+16
-5
No files found.
mysql-test/r/view.result
View file @
5963573c
...
@@ -2097,6 +2097,14 @@ select * from v1;
...
@@ -2097,6 +2097,14 @@ select * from v1;
f1
f1
1
1
drop view v1;
drop view v1;
create table t1(a int);
create procedure p1() create view v1 as select * from t1;
drop table t1;
call p1();
ERROR 42S02: Table 'test.t1' doesn't exist
call p1();
ERROR 42S02: Table 'test.t1' doesn't exist
drop procedure p1;
create table t1 (f1 int);
create table t1 (f1 int);
create table t2 (f1 int);
create table t2 (f1 int);
insert into t1 values (1);
insert into t1 values (1);
...
...
mysql-test/t/view.test
View file @
5963573c
...
@@ -1943,6 +1943,18 @@ create view v1 as select timestampdiff(day,'1997-01-01 00:00:00','1997-01-02 00:
...
@@ -1943,6 +1943,18 @@ create view v1 as select timestampdiff(day,'1997-01-01 00:00:00','1997-01-02 00:
select
*
from
v1
;
select
*
from
v1
;
drop
view
v1
;
drop
view
v1
;
#
# repeatable CREATE VIEW statement BUG#12468
#
create
table
t1
(
a
int
);
create
procedure
p1
()
create
view
v1
as
select
*
from
t1
;
drop
table
t1
;
--
error
1146
call
p1
();
--
error
1146
call
p1
();
drop
procedure
p1
;
#
#
# Bug #10624 Views with multiple UNION and UNION ALL produce incorrect results
# Bug #10624 Views with multiple UNION and UNION ALL produce incorrect results
#
#
...
...
sql/sql_view.cc
View file @
5963573c
...
@@ -230,7 +230,10 @@ bool mysql_create_view(THD *thd,
...
@@ -230,7 +230,10 @@ bool mysql_create_view(THD *thd,
(
check_access
(
thd
,
DROP_ACL
,
view
->
db
,
&
view
->
grant
.
privilege
,
(
check_access
(
thd
,
DROP_ACL
,
view
->
db
,
&
view
->
grant
.
privilege
,
0
,
0
)
||
0
,
0
)
||
grant_option
&&
check_grant
(
thd
,
DROP_ACL
,
view
,
0
,
1
,
0
))))
grant_option
&&
check_grant
(
thd
,
DROP_ACL
,
view
,
0
,
1
,
0
))))
DBUG_RETURN
(
TRUE
);
{
res
=
TRUE
;
goto
err
;
}
for
(
sl
=
select_lex
;
sl
;
sl
=
sl
->
next_select
())
for
(
sl
=
select_lex
;
sl
;
sl
=
sl
->
next_select
())
{
{
for
(
tbl
=
sl
->
get_table_list
();
tbl
;
tbl
=
tbl
->
next_local
)
for
(
tbl
=
sl
->
get_table_list
();
tbl
;
tbl
=
tbl
->
next_local
)
...
@@ -243,7 +246,8 @@ bool mysql_create_view(THD *thd,
...
@@ -243,7 +246,8 @@ bool mysql_create_view(THD *thd,
{
{
my_error
(
ER_TABLEACCESS_DENIED_ERROR
,
MYF
(
0
),
my_error
(
ER_TABLEACCESS_DENIED_ERROR
,
MYF
(
0
),
"ANY"
,
thd
->
priv_user
,
thd
->
host_or_ip
,
tbl
->
table_name
);
"ANY"
,
thd
->
priv_user
,
thd
->
host_or_ip
,
tbl
->
table_name
);
DBUG_RETURN
(
TRUE
);
res
=
TRUE
;
goto
err
;
}
}
/*
/*
Mark this table as a table which will be checked after the prepare
Mark this table as a table which will be checked after the prepare
...
@@ -302,7 +306,10 @@ bool mysql_create_view(THD *thd,
...
@@ -302,7 +306,10 @@ bool mysql_create_view(THD *thd,
#endif
#endif
if
(
open_and_lock_tables
(
thd
,
tables
))
if
(
open_and_lock_tables
(
thd
,
tables
))
DBUG_RETURN
(
TRUE
);
{
res
=
TRUE
;
goto
err
;
}
/*
/*
check that tables are not temporary and this VIEW do not used in query
check that tables are not temporary and this VIEW do not used in query
...
@@ -372,7 +379,10 @@ bool mysql_create_view(THD *thd,
...
@@ -372,7 +379,10 @@ bool mysql_create_view(THD *thd,
}
}
if
(
check_duplicate_names
(
select_lex
->
item_list
,
1
))
if
(
check_duplicate_names
(
select_lex
->
item_list
,
1
))
DBUG_RETURN
(
TRUE
);
{
res
=
TRUE
;
goto
err
;
}
#ifndef NO_EMBEDDED_ACCESS_CHECKS
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/*
/*
...
@@ -402,7 +412,8 @@ bool mysql_create_view(THD *thd,
...
@@ -402,7 +412,8 @@ bool mysql_create_view(THD *thd,
my_error
(
ER_COLUMNACCESS_DENIED_ERROR
,
MYF
(
0
),
my_error
(
ER_COLUMNACCESS_DENIED_ERROR
,
MYF
(
0
),
"create view"
,
thd
->
priv_user
,
thd
->
host_or_ip
,
item
->
name
,
"create view"
,
thd
->
priv_user
,
thd
->
host_or_ip
,
item
->
name
,
view
->
table_name
);
view
->
table_name
);
DBUG_RETURN
(
TRUE
);
res
=
TRUE
;
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