diff options
author | gluh@mysql.com/eagle.(none) <> | 2007-06-08 14:42:08 +0500 |
---|---|---|
committer | gluh@mysql.com/eagle.(none) <> | 2007-06-08 14:42:08 +0500 |
commit | a809813b0dd1856b275d61a1d4bb7a829c50e681 (patch) | |
tree | 615ff6cce7cb76242b536c7c9655a4f11a397ffd /mysql-test/t/grant2.test | |
parent | e3a13c26bda48e4eafe03e964d9417fdd48535a5 (diff) | |
download | mariadb-git-a809813b0dd1856b275d61a1d4bb7a829c50e681.tar.gz |
Bug#18660 Can't grant any privileges on single table in database with underscore char
In case of database level grant the database name may be a pattern,
in case of table|column level grant the database name can not be a pattern.
We use 'dont_check_global_grants' as a flag to determine
if it's database level grant command
(see SQLCOM_GRANT case, mysql_execute_command() function) and
set db_is_pattern according to 'dont_check_global_grants' value.
Diffstat (limited to 'mysql-test/t/grant2.test')
-rw-r--r-- | mysql-test/t/grant2.test | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test index 4a3324b1833..a3a8e2d5d53 100644 --- a/mysql-test/t/grant2.test +++ b/mysql-test/t/grant2.test @@ -555,5 +555,35 @@ drop database mysqltest_1; drop database mysqltest_2; drop user mysqltest_u1@localhost; +# +# Bug#18660 Can't grant any privileges on single table in database +# with underscore char +# +grant all on `mysqltest\_%`.* to mysqltest_1@localhost with grant option; +grant usage on *.* to mysqltest_2@localhost; +connect (con18600_1,localhost,mysqltest_1,,); + +create database mysqltest_1; +use mysqltest_1; +create table t1 (f1 int); + +grant create on `mysqltest\_1`.* to mysqltest_2@localhost; +grant select on mysqltest_1.t1 to mysqltest_2@localhost; +connect (con3,localhost,mysqltest_2,,); +connection con3; +--error 1044 +create database mysqltest_3; +use mysqltest_1; +create table t2(f1 int); +select * from t1; +connection default; +drop database mysqltest_1; + +revoke all privileges, grant option from mysqltest_1@localhost; +revoke all privileges, grant option from mysqltest_2@localhost; +drop user mysqltest_1@localhost; +drop user mysqltest_2@localhost; + + --echo End of 5.0 tests |