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
adf6fc1a
Commit
adf6fc1a
authored
Feb 26, 2009
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
null-merged the fix and kept the test for bug #41354 from 5.0-bugteam
parents
3a29b7af
b337ac28
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
0 deletions
+66
-0
mysql-test/r/view_grant.result
mysql-test/r/view_grant.result
+26
-0
mysql-test/t/view_grant.test
mysql-test/t/view_grant.test
+40
-0
No files found.
mysql-test/r/view_grant.result
View file @
adf6fc1a
...
...
@@ -921,6 +921,32 @@ c4
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2;
DROP USER mysqltest_u1@localhost;
CREATE DATABASE db1;
USE db1;
CREATE TABLE t1(f1 INT, f2 INT);
CREATE VIEW v1 AS SELECT f1, f2 FROM t1;
GRANT SELECT (f1) ON t1 TO foo;
GRANT SELECT (f1) ON v1 TO foo;
USE db1;
SELECT f1 FROM t1;
f1
SELECT f2 FROM t1;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for column 'f2' in table 't1'
SELECT * FROM t1;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't1'
SELECT f1 FROM v1;
f1
SELECT f2 FROM v1;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for column 'f2' in table 'v1'
SELECT * FROM v1;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'v1'
USE test;
REVOKE SELECT (f1) ON db1.t1 FROM foo;
REVOKE SELECT (f1) ON db1.v1 FROM foo;
DROP USER foo;
DROP VIEW db1.v1;
DROP TABLE db1.t1;
DROP DATABASE db1;
End of 5.0 tests.
DROP VIEW IF EXISTS v1;
DROP TABLE IF EXISTS t1;
...
...
mysql-test/t/view_grant.test
View file @
adf6fc1a
...
...
@@ -1191,6 +1191,46 @@ DROP DATABASE mysqltest1;
DROP
DATABASE
mysqltest2
;
DROP
USER
mysqltest_u1
@
localhost
;
#
# Bug #41354: Access control is bypassed when all columns of a view are
# selected by * wildcard
CREATE
DATABASE
db1
;
USE
db1
;
CREATE
TABLE
t1
(
f1
INT
,
f2
INT
);
CREATE
VIEW
v1
AS
SELECT
f1
,
f2
FROM
t1
;
GRANT
SELECT
(
f1
)
ON
t1
TO
foo
;
GRANT
SELECT
(
f1
)
ON
v1
TO
foo
;
connect
(
addconfoo
,
localhost
,
foo
,,);
connection
addconfoo
;
USE
db1
;
SELECT
f1
FROM
t1
;
--
error
ER_COLUMNACCESS_DENIED_ERROR
SELECT
f2
FROM
t1
;
--
error
ER_TABLEACCESS_DENIED_ERROR
SELECT
*
FROM
t1
;
SELECT
f1
FROM
v1
;
--
error
ER_COLUMNACCESS_DENIED_ERROR
SELECT
f2
FROM
v1
;
--
error
ER_TABLEACCESS_DENIED_ERROR
SELECT
*
FROM
v1
;
connection
default
;
USE
test
;
disconnect
addconfoo
;
REVOKE
SELECT
(
f1
)
ON
db1
.
t1
FROM
foo
;
REVOKE
SELECT
(
f1
)
ON
db1
.
v1
FROM
foo
;
DROP
USER
foo
;
DROP
VIEW
db1
.
v1
;
DROP
TABLE
db1
.
t1
;
DROP
DATABASE
db1
;
--
echo
End
of
5.0
tests
.
...
...
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