List:Commits« Previous MessageNext Message »
From:ramil Date:April 17 2007 11:52am
Subject:bk commit into 4.1 tree (ramil:1.2644) BUG#27515
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of ram. When ram 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-04-17 16:52:50+05:00, ramil@stripped +3 -0
  Fix for bug #27515: DROP previlege is not required anymore for RENAME TABLE
  
  Added missed DROP privilege check on the original table for RENAME TABLE command.

  mysql-test/r/grant.result@stripped, 2007-04-17 16:52:49+05:00, ramil@stripped +11 -0
    Fix for bug #27515: DROP previlege is not required anymore for RENAME TABLE
      - test result.

  mysql-test/t/grant.test@stripped, 2007-04-17 16:52:49+05:00, ramil@stripped +22 -1
    Fix for bug #27515: DROP previlege is not required anymore for RENAME TABLE
      - test case.

  sql/sql_parse.cc@stripped, 2007-04-17 16:52:49+05:00, ramil@stripped +1 -1
    Fix for bug #27515: DROP previlege is not required anymore for RENAME TABLE
      - added DROP privilege check on the original table for RENAME TABLE command.

# 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:	ramil
# Host:	ramil.myoffice.izhnet.ru
# Root:	/home/ram/work/b27515/b27515.4.1

--- 1.496/sql/sql_parse.cc	2007-04-17 16:52:53 +05:00
+++ 1.497/sql/sql_parse.cc	2007-04-17 16:52:53 +05:00
@@ -2818,7 +2818,7 @@ unsent_create_error:
 	old_list=table[0];
 	new_list=table->next[0];
 	old_list.next=new_list.next=0;
-	if (check_grant(thd, ALTER_ACL, &old_list, 0, UINT_MAX, 0) ||
+	if (check_grant(thd, ALTER_ACL | DROP_ACL, &old_list, 0, UINT_MAX, 0) ||
 	    (!test_all_bits(table->next->grant.privilege,
 			    INSERT_ACL | CREATE_ACL) &&
 	     check_grant(thd, INSERT_ACL | CREATE_ACL, &new_list, 0,

--- 1.42/mysql-test/r/grant.result	2007-04-17 16:52:53 +05:00
+++ 1.43/mysql-test/r/grant.result	2007-04-17 16:52:53 +05:00
@@ -492,3 +492,14 @@ delete from mysql.db where user='mysqlte
 delete from mysql.tables_priv where user='mysqltest1';
 flush privileges;
 drop database mysqltest;
+create database db27515;
+use db27515;
+create table t1 (a int);
+grant alter on db27515.t1 to user27515@localhost;
+grant insert, create on db27515.t2 to user27515@localhost;
+rename table t1 to t2;
+ERROR 42000: DROP command denied to user 'user27515'@'localhost' for table 't1'
+revoke all privileges, grant option from user27515@localhost;
+drop user user27515@localhost;
+drop database db27515;
+End of 4.1 tests

--- 1.35/mysql-test/t/grant.test	2007-04-17 16:52:53 +05:00
+++ 1.36/mysql-test/t/grant.test	2007-04-17 16:52:53 +05:00
@@ -451,4 +451,25 @@ delete from mysql.tables_priv where user
 flush privileges;
 drop database mysqltest;
 
-# End of 4.1 tests
+#
+# Bug #27515: DROP previlege is not required for RENAME TABLE
+#
+connection master;
+create database db27515;
+use db27515;
+create table t1 (a int);
+grant alter on db27515.t1 to user27515@localhost;
+grant insert, create on db27515.t2 to user27515@localhost;
+
+connect (conn27515, localhost, user27515, , db27515);
+connection conn27515;
+--error 1142
+rename table t1 to t2;
+disconnect conn27515;
+
+connection master;
+revoke all privileges, grant option from user27515@localhost;
+drop user user27515@localhost;
+drop database db27515;
+
+--echo End of 4.1 tests
Thread
bk commit into 4.1 tree (ramil:1.2644) BUG#27515ramil17 Apr