Bug #57384 Safe Update Feature Fails to See Where Clause
Submitted: 11 Oct 2010 20:32 Modified: 17 Nov 2010 20:28
Reporter: Scott Weigand Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.28 CE, 5.2.29 OS:Any
Assigned to: CPU Architecture:Any

[11 Oct 2010 20:32] Scott Weigand
Description:
While running a simple Update statement with a single table, a single Set statement, and a single Where clause, Safe Update feature fails to see Where clause. 

How to repeat:
With Safe Update enabled, running the following job...

UPDATE some_table
SET some_field = '0' 
WHERE email = 'leela@futurama.net';

With Safe Update enabled, it chokes and doesn't see the Where statement. With Safe update disabled, it works fine.

Suggested fix:
No suggestions. Is Safe Update a new feature? I like it, keeps dopes like me from doing something rash. It just might need some correcting.
[12 Oct 2010 6:43] Valeriy Kravchuk
Thank you for the bug report. Looks like WHERE clause is recognized if it refers to primary key column, for example, but NOT if condition on non-indexed column is provided.
[17 Nov 2010 20:28] Alfredo Kojima
The Safe Update feature in Workbench just enables a feature in the server. 
The requirement for KEY columns to be used in the WHERE statement is from the server, probably because otherwise you could still accidentally update the whole table by passing some expression that matches more rows than intended. There is nothing we can do to change that behaviour from Workbench.