List:Commits« Previous MessageNext Message »
From:gluh Date:May 22 2007 3:33pm
Subject:bk commit into 5.0 tree (gluh:1.2491) BUG#18660
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of gluh. When gluh does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-05-22 18:33:11+05:00, gluh@stripped +3 -0
  Bug#18660 Can't grant any privileges on single table in database with underscore char
  GRANT_ACL for table level privilege check is removed,
  Database name cannot be pattern in case of table level grant and
  db_is_pattern(see check_access function)
  which affected wild_compare() function should be set into 0 in this case.

  mysql-test/r/grant2.result@stripped, 2007-05-22 18:33:09+05:00, gluh@stripped +18 -0
    test result

  mysql-test/t/grant2.test@stripped, 2007-05-22 18:33:09+05:00, gluh@stripped +29 -0
    test case

  sql/sql_parse.cc@stripped, 2007-05-22 18:33:09+05:00, gluh@stripped +2 -1
    Bug#18660 Can't grant any privileges on single table in database with underscore char
    GRANT_ACL for table level privilege check is removed,
    Database name cannot be pattern in case of table level grant and
    db_is_pattern(see check_access function)
    which affected wild_compare() function should be set into 0 in this case.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	gluh
# Host:	eagle.(none)
# Root:	/home/gluh/MySQL/Bugs/5.0.18660

--- 1.621/sql/sql_parse.cc	2007-05-15 14:56:04 +05:00
+++ 1.622/sql/sql_parse.cc	2007-05-22 18:33:09 +05:00
@@ -4053,7 +4053,8 @@ end_with_restore_list:
   case SQLCOM_REVOKE:
   case SQLCOM_GRANT:
   {
-    if (check_access(thd, lex->grant | lex->grant_tot_col | GRANT_ACL,
+    if (check_access(thd, lex->grant | lex->grant_tot_col |
+                     (first_table ? 0 : GRANT_ACL),
 		     first_table ?  first_table->db : select_lex->db,
 		     first_table ? &first_table->grant.privilege : 0,
 		     first_table ? 0 : 1, 0,

--- 1.33/mysql-test/r/grant2.result	2006-10-04 16:09:34 +05:00
+++ 1.34/mysql-test/r/grant2.result	2007-05-22 18:33:09 +05:00
@@ -380,3 +380,21 @@ drop function f2;
 drop table t2;
 REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
 drop user `a@`@localhost;
+grant all on `mysqltest\_%`.* to mysqltest_1@localhost with grant option;
+grant usage on *.* to mysqltest_2@localhost;
+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;
+create database mysqltest_3;
+ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'mysqltest_3'
+use mysqltest_1;
+create table t2(f1 int);
+select * from t1;
+f1
+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;

--- 1.38/mysql-test/t/grant2.test	2007-02-26 14:49:23 +04:00
+++ 1.39/mysql-test/t/grant2.test	2007-05-22 18:33:09 +05:00
@@ -513,3 +513,32 @@ disconnect bug13310;
 connection default;
 REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
 drop user `a@`@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;
Thread
bk commit into 5.0 tree (gluh:1.2491) BUG#18660gluh22 May