mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
used right table for grants check (BUG#3270)
This commit is contained in:
@ -3,6 +3,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
|
drop database if exists mysqltest;
|
||||||
|
|
||||||
create table t1 (
|
create table t1 (
|
||||||
col1 int not null auto_increment primary key,
|
col1 int not null auto_increment primary key,
|
||||||
col2 varchar(30) not null,
|
col2 varchar(30) not null,
|
||||||
@ -99,3 +101,20 @@ select * from t1;
|
|||||||
select * from mysqltest.t1;
|
select * from mysqltest.t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
drop database mysqltest;
|
drop database mysqltest;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Rights for renaming test (Bug #3270)
|
||||||
|
#
|
||||||
|
connect (root,localhost,root,,test,0,mysql-master.sock);
|
||||||
|
connection root;
|
||||||
|
--disable_warnings
|
||||||
|
create database mysqltest;
|
||||||
|
--enable_warnings
|
||||||
|
create table mysqltest.t1 (a int,b int,c int);
|
||||||
|
grant all on mysqltest.t1 to mysqltest_1@localhost;
|
||||||
|
connect (user1,localhost,mysqltest_1,,mysqltest,0,mysql-master.sock);
|
||||||
|
connection user1;
|
||||||
|
-- error 1142
|
||||||
|
alter table t1 rename t2;
|
||||||
|
connection root;
|
||||||
|
drop database mysqltest;
|
||||||
|
@ -1446,7 +1446,7 @@ mysql_execute_command(void)
|
|||||||
tmp_table.real_name=lex->name;
|
tmp_table.real_name=lex->name;
|
||||||
tmp_table.db=lex->db;
|
tmp_table.db=lex->db;
|
||||||
tmp_table.grant.privilege=priv;
|
tmp_table.grant.privilege=priv;
|
||||||
if (check_grant(thd,INSERT_ACL | CREATE_ACL,tables))
|
if (check_grant(thd,INSERT_ACL | CREATE_ACL, &tmp_table))
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user