From: Date: November 21 2006 9:25am Subject: bk commit into 5.1 tree (gkodinov:1.2372) BUG#23556 List-Archive: http://lists.mysql.com/commits/15604 X-Bug: 23556 Message-Id: <20061121082530.58DA292ABE9@macbook.gmz> Below is the list of changes that have just been committed into a local 5.1 repository of kgeorge. When kgeorge 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, 2006-11-21 10:25:10+02:00, gkodinov@stripped +5 -0 Bug #23556: TRUNCATE TABLE still maps to DELETE - TRUNCATE requires DROP privilege, not DELETE mysql-test/r/grant.result@stripped, 2006-11-21 10:25:01+02:00, gkodinov@stripped +20 -0 Bug #23556: TRUNCATE TABLE still maps to DELETE - test case mysql-test/r/trigger-grant.result@stripped, 2006-11-21 10:25:01+02:00, gkodinov@stripped +2 -2 Bug #23556: TRUNCATE TABLE still maps to DELETE - updated test case mysql-test/t/grant.test@stripped, 2006-11-21 10:25:02+02:00, gkodinov@stripped +35 -0 Bug #23556: TRUNCATE TABLE still maps to DELETE - test case mysql-test/t/trigger-grant.test@stripped, 2006-11-21 10:25:03+02:00, gkodinov@stripped +2 -2 Bug #23556: TRUNCATE TABLE still maps to DELETE - updated test case sql/sql_parse.cc@stripped, 2006-11-21 10:25:04+02:00, gkodinov@stripped +1 -1 Bug #23556: TRUNCATE TABLE still maps to DELETE - TRUNCATE requires DROP privilege, not DELETE # 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: gkodinov # Host: macbook.gmz # Root: /Users/kgeorge/mysql/work/B23556-5.1-opt --- 1.596/sql/sql_parse.cc 2006-11-19 20:19:52 +02:00 +++ 1.597/sql/sql_parse.cc 2006-11-21 10:25:04 +02:00 @@ -3508,7 +3508,7 @@ end_with_restore_list: break; } DBUG_ASSERT(first_table == all_tables && first_table != 0); - if (check_one_table_access(thd, DELETE_ACL, all_tables)) + if (check_one_table_access(thd, DROP_ACL, all_tables)) goto error; /* Don't allow this within a transaction because we want to use --- 1.11/mysql-test/r/trigger-grant.result 2006-06-16 01:49:44 +03:00 +++ 1.12/mysql-test/r/trigger-grant.result 2006-11-21 10:25:01 +02:00 @@ -14,8 +14,8 @@ CREATE TABLE t1(num_value INT); CREATE TABLE t2(user_str TEXT); ---> connection: default -GRANT INSERT, DELETE ON mysqltest_db1.t1 TO mysqltest_dfn@localhost; -GRANT INSERT, DELETE ON mysqltest_db1.t2 TO mysqltest_dfn@localhost; +GRANT INSERT, DROP ON mysqltest_db1.t1 TO mysqltest_dfn@localhost; +GRANT INSERT, DROP ON mysqltest_db1.t2 TO mysqltest_dfn@localhost; ---> connection: default GRANT SUPER ON *.* TO mysqltest_dfn@localhost; --- 1.12/mysql-test/t/trigger-grant.test 2006-06-16 01:49:46 +03:00 +++ 1.13/mysql-test/t/trigger-grant.test 2006-11-21 10:25:03 +02:00 @@ -60,8 +60,8 @@ CREATE TABLE t2(user_str TEXT); --echo --echo ---> connection: default -GRANT INSERT, DELETE ON mysqltest_db1.t1 TO mysqltest_dfn@localhost; -GRANT INSERT, DELETE ON mysqltest_db1.t2 TO mysqltest_dfn@localhost; +GRANT INSERT, DROP ON mysqltest_db1.t1 TO mysqltest_dfn@localhost; +GRANT INSERT, DROP ON mysqltest_db1.t2 TO mysqltest_dfn@localhost; # # Check that the user must have TRIGGER privilege to create a trigger. --- 1.60/mysql-test/r/grant.result 2006-09-08 10:37:03 +03:00 +++ 1.61/mysql-test/r/grant.result 2006-11-21 10:25:01 +02:00 @@ -972,4 +972,24 @@ REVOKE EXECUTE ON PROCEDURE p1 FROM 1234 ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16) REVOKE EXECUTE ON PROCEDURE t1 FROM some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY; ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60) +CREATE USER bug23556@localhost; +CREATE DATABASE bug23556; +GRANT SELECT ON bug23556.* TO bug23556@localhost; +USE bug23556; +CREATE TABLE t1 (a INT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5); +GRANT DELETE ON t1 TO bug23556@localhost; +USE bug23556; +TRUNCATE t1; +ERROR 42000: DROP command denied to user 'bug23556'@'localhost' for table 't1' +USE bug23556; +REVOKE DELETE ON t1 FROM bug23556@localhost; +GRANT DROP ON t1 TO bug23556@localhost; +USE bug23556; +TRUNCATE t1; +USE bug23556; +DROP TABLE t1; +USE test; +DROP DATABASE bug23556; +DROP USER bug23556@localhost; End of 5.0 tests --- 1.47/mysql-test/t/grant.test 2006-09-08 10:37:03 +03:00 +++ 1.48/mysql-test/t/grant.test 2006-11-21 10:25:02 +02:00 @@ -863,4 +863,39 @@ REVOKE EXECUTE ON PROCEDURE p1 FROM 1234 --error ER_WRONG_STRING_LENGTH REVOKE EXECUTE ON PROCEDURE t1 FROM some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY; + + +# +# BUG#23556: TRUNCATE TABLE still maps to DELETE +# +CREATE USER bug23556@localhost; +CREATE DATABASE bug23556; +GRANT SELECT ON bug23556.* TO bug23556@localhost; +connect (bug23556,localhost,bug23556,,bug23556); + +connection default; +USE bug23556; +CREATE TABLE t1 (a INT PRIMARY KEY); INSERT INTO t1 VALUES (1),(2),(3),(4),(5); +GRANT DELETE ON t1 TO bug23556@localhost; + +connection bug23556; +USE bug23556; +--error ER_TABLEACCESS_DENIED_ERROR +TRUNCATE t1; + +connection default; +USE bug23556; +REVOKE DELETE ON t1 FROM bug23556@localhost; +GRANT DROP ON t1 TO bug23556@localhost; + +connection bug23556; +USE bug23556; +TRUNCATE t1; + +connection default; +USE bug23556; +DROP TABLE t1; +USE test; +DROP DATABASE bug23556; +DROP USER bug23556@localhost; --echo End of 5.0 tests