Harald Fuchs writes:
> [This is for MySQL 4.0.1 alpha on Linux 2.2.18-SMP, if it should matter]
> 
> Either I misunderstand the manual, or I found a small bug. Consider
> the following command sequence:
> 
>   mysql -e 'CREATE DATABASE t1'
>   mysql t1 -e 'CREATE TABLE t1 (id INT)'
>   mysql -e 'GRANT all ON t1.* TO t1@localhost IDENTIFIED BY "t1"'
> 
> These commands are issued by someone with full access to the server.
> Now we switch to the newly created user:
> 
>   mysql -u t1 -pt1 t1 -e 'INSERT INTO t1 (id) VALUES (1)'
>   # This works as it should
>   mysql -u t1 -pt1 t1 -e 'LOCK TABLE t1 WRITE'
>   # This gives the following error message:
>   #   select command denied to user: 't1@localhost' for table 't1'
> 
> The LOCK succeeds if I precede it with
> 
>   mysql -e 'GRANT all ON *.* TO t1@localhost IDENTIFIED BY "t1"'
> 
> but I fail to understand why setting a lock on a table in database
> "t1" needs more privileges than "all ON t1.*".  Maybe I've overlooked
> something, but neither in the MySQL documentation nor in Paul Dubois'
> book is stated which privileges are needed for "LOCK TABLE".

Hi!

I tested your case on the last version of 4.0.2 and it works fine.

I looked at code and saw that now it is only SELECT, UPDATE, INSERT
and DELETE privileges that are required on the tables to be locked.

-- 
Regards,
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Sinisa Milivojevic <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Fulltime Developer
/_/  /_/\_, /___/\___\_\___/   Larnaca, Cyprus
       <___/   www.mysql.com


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to