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
a51ea111
Commit
a51ea111
authored
Jun 23, 2003
by
monty@narttu.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SHOW GRANTS hided real grants when grants on both column and table (Bug 654)
parent
3bd661a6
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
279 additions
and
167 deletions
+279
-167
mysql-test/r/grant.result
mysql-test/r/grant.result
+42
-5
mysql-test/t/grant.test
mysql-test/t/grant.test
+32
-2
sql/sql_acl.cc
sql/sql_acl.cc
+203
-158
sql/sql_acl.h
sql/sql_acl.h
+2
-2
No files found.
mysql-test/r/grant.result
View file @
a51ea111
drop table if exists t1;
delete from mysql.user where user='mysqltest_1';
delete from mysql.user where user='mysqltest_1';
delete from mysql.db where user='mysqltest_1';
delete from mysql.db where user='mysqltest_1';
flush privileges;
flush privileges;
...
@@ -64,8 +65,44 @@ GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, CREATE TE
...
@@ -64,8 +65,44 @@ GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, CREATE TE
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
delete from mysql.user where user='mysqltest_1';
delete from mysql.user where user='mysqltest_1';
flush privileges;
flush privileges;
grant usage on test.* to user@localhost with grant option;
grant usage on test.* to mysqltest_1@localhost with grant option;
show grants for user@localhost;
show grants for mysqltest_1@localhost;
Grants for user@localhost
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'user'@'localhost'
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT USAGE ON `test`.* TO 'user'@'localhost' WITH GRANT OPTION
GRANT USAGE ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION
GRANT USAGE ON `test`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION
delete from mysql.user where user='mysqltest_1';
delete from mysql.db where user='mysqltest_1';
delete from mysql.tables_priv where user='mysqltest_1';
delete from mysql.columns_priv where user='mysqltest_1';
flush privileges;
create table t1 (a int);
GRANT select,update,insert on t1 to mysqltest_1@localhost;
GRANT select (a), update (a),insert(a), references(a) on t1 to mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT, SELECT (a), INSERT, INSERT (a), UPDATE, UPDATE (a), REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost'
select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1";
table_priv column_priv
Select,Insert,Update Select,Insert,Update,References
REVOKE select (a), update on t1 from mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT, INSERT, INSERT (a), REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost'
REVOKE insert,insert (a) on t1 from mysqltest_1@localhost;
GRANT references on t1 to mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT, REFERENCES, REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost'
select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1";
table_priv column_priv
Select,References References
delete from mysql.user where user='mysqltest_1';
delete from mysql.db where user='mysqltest_1';
delete from mysql.tables_priv where user='mysqltest_1';
delete from mysql.columns_priv where user='mysqltest_1';
flush privileges;
drop table t1;
mysql-test/t/grant.test
View file @
a51ea111
--
disable_warnings
drop
table
if
exists
t1
;
--
enable_warnings
#
#
# Test that SSL options works properly
# Test that SSL options works properly
#
#
...
@@ -39,6 +43,32 @@ show grants for mysqltest_1@localhost;
...
@@ -39,6 +43,32 @@ show grants for mysqltest_1@localhost;
revoke
all
privileges
on
mysqltest
.*
from
mysqltest_1
@
localhost
;
revoke
all
privileges
on
mysqltest
.*
from
mysqltest_1
@
localhost
;
delete
from
mysql
.
user
where
user
=
'mysqltest_1'
;
delete
from
mysql
.
user
where
user
=
'mysqltest_1'
;
flush
privileges
;
flush
privileges
;
grant
usage
on
test
.*
to
user
@
localhost
with
grant
option
;
grant
usage
on
test
.*
to
mysqltest_1
@
localhost
with
grant
option
;
show
grants
for
user
@
localhost
;
show
grants
for
mysqltest_1
@
localhost
;
delete
from
mysql
.
user
where
user
=
'mysqltest_1'
;
delete
from
mysql
.
db
where
user
=
'mysqltest_1'
;
delete
from
mysql
.
tables_priv
where
user
=
'mysqltest_1'
;
delete
from
mysql
.
columns_priv
where
user
=
'mysqltest_1'
;
flush
privileges
;
#
# Test what happens when you have same table and colum level grants
#
create
table
t1
(
a
int
);
GRANT
select
,
update
,
insert
on
t1
to
mysqltest_1
@
localhost
;
GRANT
select
(
a
),
update
(
a
),
insert
(
a
),
references
(
a
)
on
t1
to
mysqltest_1
@
localhost
;
show
grants
for
mysqltest_1
@
localhost
;
select
table_priv
,
column_priv
from
mysql
.
tables_priv
where
user
=
"mysqltest_1"
;
REVOKE
select
(
a
),
update
on
t1
from
mysqltest_1
@
localhost
;
show
grants
for
mysqltest_1
@
localhost
;
REVOKE
insert
,
insert
(
a
)
on
t1
from
mysqltest_1
@
localhost
;
GRANT
references
on
t1
to
mysqltest_1
@
localhost
;
show
grants
for
mysqltest_1
@
localhost
;
select
table_priv
,
column_priv
from
mysql
.
tables_priv
where
user
=
"mysqltest_1"
;
delete
from
mysql
.
user
where
user
=
'mysqltest_1'
;
delete
from
mysql
.
db
where
user
=
'mysqltest_1'
;
delete
from
mysql
.
tables_priv
where
user
=
'mysqltest_1'
;
delete
from
mysql
.
columns_priv
where
user
=
'mysqltest_1'
;
flush
privileges
;
drop
table
t1
;
sql/sql_acl.cc
View file @
a51ea111
This diff is collapsed.
Click to expand it.
sql/sql_acl.h
View file @
a51ea111
...
@@ -76,8 +76,8 @@
...
@@ -76,8 +76,8 @@
#define get_rights_for_db(A) (((A) & 63) | (((A) & DB_CHUNK1) >> 4) | (((A) & DB_CHUNK2) >> 6))
#define get_rights_for_db(A) (((A) & 63) | (((A) & DB_CHUNK1) >> 4) | (((A) & DB_CHUNK2) >> 6))
#define fix_rights_for_table(A) (((A) & 63) | (((A) & ~63) << 4))
#define fix_rights_for_table(A) (((A) & 63) | (((A) & ~63) << 4))
#define get_rights_for_table(A) (((A) & 63) | (((A) & ~63) >> 4))
#define get_rights_for_table(A) (((A) & 63) | (((A) & ~63) >> 4))
#define fix_rights_for_column(A) (((A) & 7) | (((A) & ~7) <<
7
))
#define fix_rights_for_column(A) (((A) & 7) | (((A) & ~7) <<
8
))
#define get_rights_for_column(A) (((A) & 7) | ((
(A) & ~7) >> 7
))
#define get_rights_for_column(A) (((A) & 7) | ((
A) >> 8
))
/* prototypes */
/* prototypes */
...
...
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