Bug #8884 | TRIGGERS: Create trigger succeeds even when user does not have UPDATE privilege | ||
---|---|---|---|
Submitted: | 2 Mar 2005 12:29 | Modified: | 15 Sep 2005 17:52 |
Reporter: | Disha | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.0.2 | OS: | Windows (Windows Server 2003/Linux) |
Assigned to: | Antony Curtis | CPU Architecture: | Any |
[2 Mar 2005 12:29]
Disha
[2 Mar 2005 22:16]
Jorge del Conde
Verified using 5.0.3 from bk Thanks for your bug report
[13 Aug 2005 7:13]
Vasily Kishkin
I tested on 5.0.11 and have follow messages: on Linux SUSE 9.3: mysql> Use test1; ERROR 1044 (42000): Access denied for user 'Test_user1'@'%' to database 'test1' on Windows 2003: mysql> Update t1 Set f2=999 where f1=1; ERROR 1142 (42000): UPDATE command denied to user 'Test_user1'@'localhost' for table 't1' I would like to notice then Linux version permits to change database, it's very strange.
[15 Aug 2005 15:59]
MySQL Verification Team
Verified on Windows/Linux. The update command is denied but the create trigger is allowed: mysql> Use test2; Database changed mysql> Update t1 Set f2=999 where f1=1; ERROR 1142 (42000): UPDATE command denied to user 'Test_User2'@'192.168.0.119' for table 't1' mysql> show grants for "Test_User2"; +-----------------------------------------------+ | Grants for Test_User2@% | +-----------------------------------------------+ | GRANT SUPER ON *.* TO 'Test_User2'@'%' | | GRANT SELECT ON `test2`.* TO 'Test_User2'@'%' | +-----------------------------------------------+ 2 rows in set (0.00 sec) mysql> Create Trigger TRG1 before insert on t1 for each row SET NEW.f1=999; Query OK, 0 rows affected (0.01 sec) c:\mysql\bin>mysql -uTest_User2 -hlight test2 -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 12 to server version: 5.0.12-beta-nt Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> Update t1 Set f2=999 where f1=1; ERROR 1142 (42000): UPDATE command denied to user 'Test_User2'@'light' for table 't1' mysql> Create Trigger TRG1 before insert on t1 for each row SET NEW.f1=999; Query OK, 0 rows affected (0.05 sec) mysql> show grants for Test_User2; +-----------------------------------------------+ | Grants for Test_User2@% | +-----------------------------------------------+ | GRANT SUPER ON *.* TO 'Test_User2'@'%' | | GRANT SELECT ON `test2`.* TO 'Test_User2'@'%' | +-----------------------------------------------+ 2 rows in set (0.00 sec) mysql>
[30 Aug 2005 14:54]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/29029
[15 Sep 2005 17:52]
Sergei Golubchik
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.mysql.com/documentation/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php Additional info: This is not a bug. According to SQL2003, part 2 "foundations", section 11.39 <trigger definition>, paragraphs 2 and 3 of "Access Rules", to create a trigger one needs TRIGGER privilege and possibly SELECT privilege. UPDATE privilege is not required.