Workbench called me a dummy!

I use Workbench for my daily work, and it’s a great tool. If you haven’t tried the 5.2 release yet, you should. While performing some maintenance, I happened to issue a DELETE statement against a table which had no indexes (it was 10 rows), and Workbench complained:

Error Code: 1175
You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column

It turns out this is a new feature in 5.2.26 (and is still there in 5.2.27) – Workbench now uses the equivalent of –safe-updates mode for the mysql command-line client (also known as the –i-am-a-dummy option – seriously). This wasn’t exactly convenient for me, especially since the DELETE was part of a larger script which I then had to revise and step through manually after it failed, but there’s an easy way to change this behavior. If you’re like me, you might consider disabling this:

Go to Edit -> Preferences

Select the SQL Editor tab

Uncheck “Forbid UPDATE and DELETE statements without a WHERE clause (safe updates)”

Despite the text, the –safe-updates mode affects more than UPDATE and DELETE statements without WHERE clauses – it requires such statements to explicitly use indexes.

I’m changing this behavior on my installation before I run into other problems.

From your description alone, that sounds like a bug. It would be best for you to report it at bugs.mysql.com and provide more detail (actual table definition will be helpful).

What I can say is that Workbench only sets a server-side session variable, and the actual error comes from the MySQL Server itself (which also does the actual parsing of the query and makes the decision whether it violates the –safe-updates mode or not). That means that if there actually is a bug, it’s most likely caused by MySQL Server (not Workbench). Including in the bug report the version of MySQL Server being used will therefore also be helpful.