mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
Fixes (bug #6932: 'revoke all privileges...' doesn't remove all proper columns from columns_priv
bug #6933: error in the tests/grant.pl test).
This commit is contained in:
parent
50c02f463b
commit
c78eefbc95
4 changed files with 36 additions and 3 deletions
|
@ -321,3 +321,23 @@ DROP DATABASE testdb7;
|
||||||
DROP DATABASE testdb8;
|
DROP DATABASE testdb8;
|
||||||
DROP DATABASE testdb9;
|
DROP DATABASE testdb9;
|
||||||
DROP DATABASE testdb10;
|
DROP DATABASE testdb10;
|
||||||
|
create table t1(a int, b int, c int, d int);
|
||||||
|
grant insert(b), insert(c), insert(d), insert(a) on t1 to grant_user@localhost;
|
||||||
|
show grants for grant_user@localhost;
|
||||||
|
Grants for grant_user@localhost
|
||||||
|
GRANT USAGE ON *.* TO 'grant_user'@'localhost'
|
||||||
|
GRANT INSERT (a, d, c, b) ON `test`.`t1` TO 'grant_user'@'localhost'
|
||||||
|
select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv;
|
||||||
|
Host Db User Table_name Column_name Column_priv
|
||||||
|
localhost test grant_user t1 c Insert
|
||||||
|
localhost test grant_user t1 b Insert
|
||||||
|
localhost test grant_user t1 a Insert
|
||||||
|
localhost test grant_user t1 d Insert
|
||||||
|
revoke ALL PRIVILEGES on t1 from grant_user@localhost;
|
||||||
|
show grants for grant_user@localhost;
|
||||||
|
Grants for grant_user@localhost
|
||||||
|
GRANT USAGE ON *.* TO 'grant_user'@'localhost'
|
||||||
|
select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv;
|
||||||
|
Host Db User Table_name Column_name Column_priv
|
||||||
|
drop user grant_user@localhost;
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -267,3 +267,16 @@ DROP DATABASE testdb8;
|
||||||
DROP DATABASE testdb9;
|
DROP DATABASE testdb9;
|
||||||
DROP DATABASE testdb10;
|
DROP DATABASE testdb10;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #6932: a problem with 'revoke ALL PRIVILEGES'
|
||||||
|
#
|
||||||
|
|
||||||
|
create table t1(a int, b int, c int, d int);
|
||||||
|
grant insert(b), insert(c), insert(d), insert(a) on t1 to grant_user@localhost;
|
||||||
|
show grants for grant_user@localhost;
|
||||||
|
select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv;
|
||||||
|
revoke ALL PRIVILEGES on t1 from grant_user@localhost;
|
||||||
|
show grants for grant_user@localhost;
|
||||||
|
select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv;
|
||||||
|
drop user grant_user@localhost;
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -2035,7 +2035,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
|
||||||
{
|
{
|
||||||
table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS);
|
table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS);
|
||||||
if (table->file->index_read(table->record[0], (byte*) table->field[0]->ptr,
|
if (table->file->index_read(table->record[0], (byte*) table->field[0]->ptr,
|
||||||
table->key_info[0].key_length,
|
key_length,
|
||||||
HA_READ_KEY_EXACT))
|
HA_READ_KEY_EXACT))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
|
|
@ -74,9 +74,9 @@ safe_query("revoke select(user) on mysql.user from $user");
|
||||||
|
|
||||||
safe_query("grant select on *.* to $user");
|
safe_query("grant select on *.* to $user");
|
||||||
safe_query("set password FOR ${opt_user}2\@$opt_host = password('test')",1);
|
safe_query("set password FOR ${opt_user}2\@$opt_host = password('test')",1);
|
||||||
safe_query("set password FOR $opt_user=password('test')");
|
safe_query("set password FOR $opt_user\@$opt_host=password('test')");
|
||||||
user_connect(1);
|
user_connect(1);
|
||||||
safe_query("set password FOR $opt_user=''");
|
safe_query("set password FOR $opt_user\@$opt_host=''");
|
||||||
user_connect(0);
|
user_connect(0);
|
||||||
user_query("select * from mysql.user where user = '$opt_user'");
|
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'");
|
||||||
|
|
Loading…
Add table
Reference in a new issue