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
10cd77ed
Commit
10cd77ed
authored
May 08, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More tests
parent
c0b9a349
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
tests/grant.pl
tests/grant.pl
+8
-2
tests/grant.res
tests/grant.res
+14
-4
No files found.
tests/grant.pl
View file @
10cd77ed
...
@@ -82,6 +82,7 @@ user_query("select * from mysql.user where user = '$opt_user'");
...
@@ -82,6 +82,7 @@ user_query("select * from mysql.user where user = '$opt_user'");
user_query
("
select * from mysql.db where user = '
$opt_user
'
");
user_query
("
select * from mysql.db where user = '
$opt_user
'
");
safe_query
("
grant select on *.* to
$user
,
$user
");
safe_query
("
grant select on *.* to
$user
,
$user
");
safe_query
("
show grants for
$user
");
safe_query
("
show grants for
$user
");
user_connect
(
0
);
# The following should fail
# The following should fail
user_query
("
insert into mysql.user (host,user) values ('error','
$opt_user
')
",
1
);
user_query
("
insert into mysql.user (host,user) values ('error','
$opt_user
')
",
1
);
...
@@ -95,16 +96,21 @@ safe_query("grant select on $opt_database.not_exists to $opt_user",1);
...
@@ -95,16 +96,21 @@ safe_query("grant select on $opt_database.not_exists to $opt_user",1);
safe_query
("
grant FILE on
$opt_database
.test to
$opt_user
",
1
);
safe_query
("
grant FILE on
$opt_database
.test to
$opt_user
",
1
);
safe_query
("
grant select on *.* to wrong___________user_name
",
1
);
safe_query
("
grant select on *.* to wrong___________user_name
",
1
);
safe_query
("
grant select on
$opt_database
.* to wrong___________user_name
",
1
);
safe_query
("
grant select on
$opt_database
.* to wrong___________user_name
",
1
);
user_connect
(
0
);
user_query
("
grant select on
$opt_database
.test to
$opt_user
with grant option
",
1
);
user_query
("
grant select on
$opt_database
.test to
$opt_user
with grant option
",
1
);
safe_query
("
set password FOR ''
\
@''=''
",
1
);
safe_query
("
set password FOR ''
\
@''=''
",
1
);
user_query
("
set password FOR root
\
@
$opt_host
= password('test')
",
1
);
user_query
("
set password FOR root
\
@
$opt_host
= password('test')
",
1
);
# Change privileges for user
# Change privileges for user
safe_query
("
revoke select on *.* from
$user
");
safe_query
("
revoke select on *.* from
$user
");
safe_query
("
grant create on *.* to
$user
");
safe_query
("
grant create
,update
on *.* to
$user
");
user_connect
(
0
);
user_connect
(
0
);
safe_query
("
flush privileges
");
user_query
("
create table
$opt_database
.test (a int,b int)
");
user_query
("
create table
$opt_database
.test (a int,b int)
");
user_query
("
update
$opt_database
.test set b=b+1 where a > 0
",
1
);
safe_query
("
show grants for
$user
");
safe_query
("
revoke update on *.* from
$user
");
user_connect
(
0
);
safe_query
("
grant select(c) on
$opt_database
.test to
$user
",
1
);
safe_query
("
grant select(c) on
$opt_database
.test to
$user
",
1
);
safe_query
("
revoke select(c) on
$opt_database
.test from
$user
",
1
);
safe_query
("
revoke select(c) on
$opt_database
.test from
$user
",
1
);
safe_query
("
grant select on
$opt_database
.test to wrong___________user_name
",
1
);
safe_query
("
grant select on
$opt_database
.test to wrong___________user_name
",
1
);
...
...
tests/grant.res
View file @
10cd77ed
...
@@ -28,6 +28,7 @@ grant select on *.* to grant_user@localhost,grant_user@localhost
...
@@ -28,6 +28,7 @@ grant select on *.* to grant_user@localhost,grant_user@localhost
show grants for grant_user@localhost
show grants for grant_user@localhost
GRANT SELECT ON *.* TO 'grant_user'@'localhost'
GRANT SELECT ON *.* TO 'grant_user'@'localhost'
Connecting grant_user
insert into mysql.user (host,user) values ('error','grant_user')
insert into mysql.user (host,user) values ('error','grant_user')
Error in execute: insert command denied to user: 'grant_user@localhost' for table 'user'
Error in execute: insert command denied to user: 'grant_user@localhost' for table 'user'
update mysql.user set host='error' WHERE user='grant_user'
update mysql.user set host='error' WHERE user='grant_user'
...
@@ -50,6 +51,7 @@ grant select on *.* to wrong___________user_name
...
@@ -50,6 +51,7 @@ grant select on *.* to wrong___________user_name
Error in execute: The host or user argument to GRANT is too long
Error in execute: The host or user argument to GRANT is too long
grant select on grant_test.* to wrong___________user_name
grant select on grant_test.* to wrong___________user_name
Error in execute: The host or user argument to GRANT is too long
Error in execute: The host or user argument to GRANT is too long
Connecting grant_user
grant select on grant_test.test to grant_user with grant option
grant select on grant_test.test to grant_user with grant option
Error in execute: grant command denied to user: 'grant_user@localhost' for table 'test'
Error in execute: grant command denied to user: 'grant_user@localhost' for table 'test'
set password FOR ''@''=''
set password FOR ''@''=''
...
@@ -57,9 +59,17 @@ Error in execute: Can't find any matching row in the user table
...
@@ -57,9 +59,17 @@ Error in execute: Can't find any matching row in the user table
set password FOR root@localhost = password('test')
set password FOR root@localhost = password('test')
Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
revoke select on *.* from grant_user@localhost
revoke select on *.* from grant_user@localhost
grant create on *.* to grant_user@localhost
grant create
,update
on *.* to grant_user@localhost
Connecting grant_user
Connecting grant_user
flush privileges
create table grant_test.test (a int,b int)
create table grant_test.test (a int,b int)
update grant_test.test set b=b+1 where a > 0
Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'a' in table 'test'
show grants for grant_user@localhost
GRANT UPDATE, CREATE ON *.* TO 'grant_user'@'localhost'
revoke update on *.* from grant_user@localhost
Connecting grant_user
grant select(c) on grant_test.test to grant_user@localhost
grant select(c) on grant_test.test to grant_user@localhost
Error in execute: Unknown column 'c' in 'test'
Error in execute: Unknown column 'c' in 'test'
revoke select(c) on grant_test.test from grant_user@localhost
revoke select(c) on grant_test.test from grant_user@localhost
...
@@ -214,9 +224,9 @@ revoke UPDATE on *.* from grant_user@localhost
...
@@ -214,9 +224,9 @@ revoke UPDATE on *.* from grant_user@localhost
revoke SELECT on grant_test.* from grant_user@localhost
revoke SELECT on grant_test.* from grant_user@localhost
Connecting grant_user
Connecting grant_user
update grant_test.test set b=b+1 where a > 0
update grant_test.test set b=b+1 where a > 0
Error in execute:
select
command denied to user: 'grant_user@localhost' for column 'a' in table 'test'
Error in execute:
SELECT
command denied to user: 'grant_user@localhost' for column 'a' in table 'test'
update grant_test.test set b=b+1
update grant_test.test set b=b+1
Error in execute:
select
command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
Error in execute:
SELECT
command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
select * from test
select * from test
Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
grant select on grant_test.test to grant_user@localhost
grant select on grant_test.test to grant_user@localhost
...
@@ -504,7 +514,7 @@ Error in execute: Access denied for user: 'grant_user@localhost' to database 'gr
...
@@ -504,7 +514,7 @@ Error in execute: Access denied for user: 'grant_user@localhost' to database 'gr
grant LOCK TABLES on *.* to grant_user@localhost
grant LOCK TABLES on *.* to grant_user@localhost
show grants for grant_user@localhost
show grants for grant_user@localhost
GRANT LOCK TABLES ON *.* TO 'grant_user'@'localhost'
GRANT LOCK TABLES ON *.* TO 'grant_user'@'localhost'
GRANT SELECT, INSERT ON
grant_test.test3
TO 'grant_user'@'localhost'
GRANT SELECT, INSERT ON
`grant_test`.`test3`
TO 'grant_user'@'localhost'
select * from mysql.user where user='grant_user'
select * from mysql.user where user='grant_user'
127.0.0.1 grant_user 7f70e8b858ee6782 N N N N N N N N N N N N N N N N N N N N N 0 0 0
127.0.0.1 grant_user 7f70e8b858ee6782 N N N N N N N N N N N N N N N N N N N N N 0 0 0
...
...
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