Bug #5123 DELETE not working with EXISTS
Submitted: 20 Aug 2004 13:33 Modified: 31 Aug 2004 19:22
Reporter: Andreas Götz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.3 OS:Windows (WinXP SP1)
Assigned to: Documentation Team CPU Architecture:Any

[20 Aug 2004 13:33] Andreas Götz
Description:
DELTE doesn't seem to work with EXISTS (does in oracle):

SELECT * FROM actors a WHERE exists (
SELECT '1' FROM `actors` b WHERE b.name = a.name and b.id <> a.id)
and actorid = ''

works fine

How to repeat:
DELETE FROM actors a WHERE exists (
SELECT '1' FROM `actors` b WHERE b.name = a.name and b.id <> a.id)
and actorid = ''

throws a sql error

Suggested fix:
enable delete with exists- this will get rid of the ugly temporary tables nobady wants :)
[20 Aug 2004 22:24] Matthew Lord
Dear User,

Thank you for your bug report!  This is a feature request and that is one of the fields which I 
cannot change.

If you would like to see this feature could you re-submit this and mark it as a feature request?

Best Regards
[20 Aug 2004 22:44] Matthew Lord
Dear User,

I apologize, I can change this to a feature request and I just have :).

Best Regards
[25 Aug 2004 14:33] Andreas Götz
Matthew,

from the documentation I'm not sure why this is a feature request? Both select and delete seem to share the same where_definitions to be used. Why should the EXISTS then work with SELECT, but not with DELETE?

Thanks,
Andi
[26 Aug 2004 14:08] Oleksandr Byelkin
Thank you for bugreport! 
It is current limitation, one can't change table and select the same table in subquery in 
one statement. And it looks like our documentation lack description of it, I hope it will be 
fixed, soon.
[31 Aug 2004 19:22] Paul DuBois
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).
[26 Apr 2007 9:43] Christiaan Ottow
It seems that in version 5.0 this bug still exists. Neither is it changed in the documentation. To me it seems like a rather large issue,  perhaps something should be done about it?