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
31ed3fd3
Commit
31ed3fd3
authored
Jun 12, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/kgeorge/mysql/5.0/clean
into mysql.com:/home/kgeorge/mysql/5.0/B20363
parents
3f19b05b
e7daa497
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
1 deletion
+76
-1
mysql-test/r/view_grant.result
mysql-test/r/view_grant.result
+29
-0
mysql-test/t/view_grant.test
mysql-test/t/view_grant.test
+39
-0
sql/sql_parse.cc
sql/sql_parse.cc
+8
-1
No files found.
mysql-test/r/view_grant.result
View file @
31ed3fd3
...
@@ -618,3 +618,32 @@ ERROR HY000: There is no 'no-such-user'@'localhost' registered
...
@@ -618,3 +618,32 @@ ERROR HY000: There is no 'no-such-user'@'localhost' registered
DROP VIEW v;
DROP VIEW v;
DROP TABLE t1;
DROP TABLE t1;
USE test;
USE test;
CREATE USER mysqltest_db1@localhost identified by 'PWD';
GRANT ALL ON mysqltest_db1.* TO mysqltest_db1@localhost WITH GRANT OPTION;
CREATE SCHEMA mysqltest_db1 ;
USE mysqltest_db1 ;
CREATE TABLE t1 (f1 INTEGER);
CREATE VIEW view1 AS
SELECT * FROM t1;
SHOW CREATE VIEW view1;
View Create View
view1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_db1`@`localhost` SQL SECURITY DEFINER VIEW `view1` AS select `t1`.`f1` AS `f1` from `t1`
CREATE VIEW view2 AS
SELECT * FROM view1;
# Here comes a suspicious warning
SHOW CREATE VIEW view2;
View Create View
view2 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_db1`@`localhost` SQL SECURITY DEFINER VIEW `view2` AS select `view1`.`f1` AS `f1` from `view1`
# But the view view2 is usable
SELECT * FROM view2;
f1
CREATE VIEW view3 AS
SELECT * FROM view2;
SELECT * from view3;
f1
DROP VIEW mysqltest_db1.view3;
DROP VIEW mysqltest_db1.view2;
DROP VIEW mysqltest_db1.view1;
DROP TABLE mysqltest_db1.t1;
DROP SCHEMA mysqltest_db1;
DROP USER mysqltest_db1@localhost;
mysql-test/t/view_grant.test
View file @
31ed3fd3
...
@@ -807,3 +807,42 @@ SELECT * FROM v;
...
@@ -807,3 +807,42 @@ SELECT * FROM v;
DROP
VIEW
v
;
DROP
VIEW
v
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
USE
test
;
USE
test
;
#
# Bug#20363: Create view on just created view is now denied
#
eval
CREATE
USER
mysqltest_db1
@
localhost
identified
by
'PWD'
;
eval
GRANT
ALL
ON
mysqltest_db1
.*
TO
mysqltest_db1
@
localhost
WITH
GRANT
OPTION
;
# The session with the non root user is needed.
--
replace_result
$MASTER_MYPORT
MYSQL_PORT
$MASTER_MYSOCK
MYSQL_SOCK
connect
(
session1
,
localhost
,
mysqltest_db1
,
PWD
,
test
);
CREATE
SCHEMA
mysqltest_db1
;
USE
mysqltest_db1
;
CREATE
TABLE
t1
(
f1
INTEGER
);
CREATE
VIEW
view1
AS
SELECT
*
FROM
t1
;
SHOW
CREATE
VIEW
view1
;
CREATE
VIEW
view2
AS
SELECT
*
FROM
view1
;
--
echo
# Here comes a suspicious warning
SHOW
CREATE
VIEW
view2
;
--
echo
# But the view view2 is usable
SELECT
*
FROM
view2
;
CREATE
VIEW
view3
AS
SELECT
*
FROM
view2
;
SELECT
*
from
view3
;
connection
default
;
DROP
VIEW
mysqltest_db1
.
view3
;
DROP
VIEW
mysqltest_db1
.
view2
;
DROP
VIEW
mysqltest_db1
.
view1
;
DROP
TABLE
mysqltest_db1
.
t1
;
DROP
SCHEMA
mysqltest_db1
;
DROP
USER
mysqltest_db1
@
localhost
;
sql/sql_parse.cc
View file @
31ed3fd3
...
@@ -5004,7 +5004,14 @@ bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *all_tables)
...
@@ -5004,7 +5004,14 @@ bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *all_tables)
if
(
all_tables
->
security_ctx
)
if
(
all_tables
->
security_ctx
)
thd
->
security_ctx
=
all_tables
->
security_ctx
;
thd
->
security_ctx
=
all_tables
->
security_ctx
;
if
(
check_access
(
thd
,
privilege
,
all_tables
->
db
,
const
char
*
db_name
;
if
((
all_tables
->
view
||
all_tables
->
field_translation
)
&&
!
all_tables
->
schema_table
)
db_name
=
all_tables
->
view_db
.
str
;
else
db_name
=
all_tables
->
db
;
if
(
check_access
(
thd
,
privilege
,
db_name
,
&
all_tables
->
grant
.
privilege
,
0
,
0
,
&
all_tables
->
grant
.
privilege
,
0
,
0
,
test
(
all_tables
->
schema_table
)))
test
(
all_tables
->
schema_table
)))
goto
deny
;
goto
deny
;
...
...
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