Bug #59371 clarification for --safe-updates
Submitted: 8 Jan 2011 21:10 Modified: 8 Jan 2011 21:18
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:any OS:Any
Assigned to: CPU Architecture:Any

[8 Jan 2011 21:10] Peter Laursen
Description:
http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_sql_safe_update...

sql_safe_updates: If set to 1, MySQL aborts UPDATE or DELETE statements that do not use a key in the WHERE clause or a LIMIT clause.

From this it is unclear if a statement like 

DELETE FROM table;

.. will work or not. There is no WHERE-clause at all so the wording "that do not use a key in the WHERE clause" does not cover this case.

How to repeat:
See above.

(Besides it is related to / originates from: http://bugs.mysql.com/?id=59370)

Suggested fix:
Clarify in docs if DELETE with no WHERE works with --safe-updates.
[8 Jan 2011 21:18] Peter Laursen
Please ignore.  I understand now that there will have to be either

* a LIMIT clause
or
* a WHERE clause on a column that use and index.