Bug #25277 Can't drop database when user has all rights
Submitted: 26 Dec 2006 6:43 Modified: 15 Jan 2007 13:48
Reporter: Jared S (Silver Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.2.8 OS:NT 6.0
Assigned to: Mike Lischke CPU Architecture:Any
Tags: databse, Drop, user

[26 Dec 2006 6:43] Jared S
Description:
Hi.  I have created a simple database and a simple user and given the user all access to the respective database.  But, I cannot delete the database from Query Browser when logged in as the respective user.

I Have seen a similar bug fixed with Administrator when user could not backup database, cause of rights issue.  And I think this bug is the same scenario, although the user may not have access to mysql table, they should be given special rights when it come to deleting their own database which they have full rights to.  Please see bug http://bugs.mysql.com/bug.php?id=24808 | Mike Lischke

How to repeat:
1. Create new DB
2. Create new user and give user all access to the new dB
3. Logon to QB.EXE as the new user and try to delete respective database

-- sample database, but needs a user created as well 

CREATE DATABASE IF NOT EXISTS test;
USE test;

DROP TABLE IF EXISTS `mytable`;
CREATE TABLE `mytable` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `description` varchar(64) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `mytable` (`id`,`description`) VALUES 
 (1,'Hi there.');

Suggested fix:
Could we allow the user to see schema "mysql"
[26 Dec 2006 11:16] Sveta Smirnova
Thank you for the report.

Bug has parially verified:

I can drop test schema, but I see error: "Error while executing query SELECT COUNT(*) FROM mysql.db WHERE db='test' ...."
[15 Jan 2007 13:48] Mike Lischke
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html