Bug #36776 DROP USER: support IF EXISTS
Submitted: 17 May 2008 11:54 Modified: 21 Feb 2009 23:28
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Security: Privileges Severity:S4 (Feature request)
Version:5.0.51 OS:Any (MS Windows, Linux)
Assigned to: CPU Architecture:Any

[17 May 2008 11:54] Peter Laursen
Description:
DO

create user 'fooly'@'localhost' identified by 'sample';
drop user if exists 'fooly'@'localhost';  -- error 1064: you have blahblab
drop user 'fooly'@'localhost'; -- 0 rows affected

How to repeat:
create user 'fooly'@'localhost' identified by 'sample';
drop user if exists 'fooly'@'localhost';  -- error 1064: you have blahblah
drop user 'fooly'@'localhost'; -- 0 rows affected
create user if not exists 'fooly'@'localhost' identified by 'sample'; -- -- error 1064: you have blahblah

Suggested fix:
1) *if exists*/*if not exist* should be supported in DROP/CREATE USER
2) as one row was deleted from the `users` table *1 rows affected* should be returned
[17 May 2008 14:11] Sveta Smirnova
Thank you for the reasonable feature request.
[30 Sep 2008 18:47] Konstantin Osipov
Peter,
could you please report a separate bug for wrong row count?
Wrong row count is not a feature request.
[30 Sep 2008 19:40] Peter Laursen
created! http://bugs.mysql.com/bug.php?id=39762
[21 Feb 2009 23:28] Peter Gulutzan
Duplicate of Bug#19166, which is a duplicate of Bug#15287, etc.