Description:
----[For better reports, please attach the log file after submitting. You can find it in /Users/wjaspers/Library/Application Support/MySQL/Workbench/log/wb.log]
It appears the MySQL dialect is interpreted in the MySQL workbench as MySQL 8 with SAFE MODE enabled by default before the request is actually sent to the server. No default connection options or workbench settings hint that safe mode is enabled (although i would expect that it is a good default).
The same UPDATE query can be run against the server via other means and NOT encounter the same error.
This was tested in version 8.0.13 and 8.0.16
How to repeat:
```
CREATE TABLE `dependency` (
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
code CHAR(255) NOT NULL
);
CREATE TABLE `test` (
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
code CHAR(255) NOT NULL,
value TINYINT(1) NOT NULL DEFAULT 0,
dependency_id INT NULL,
FOREIGN KEY `dependency_fk` (`dependency_id`) REFERENCES `dependency` (`id`)
);
-- THIS QUERY FAILS WITH ERROR CODE 1175
UPDATE `test` SET `value` = 1 WHERE `code` = 'ANYTHING';
```
Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect.
```
-- Works around the safe mode error
UPDATE `test` SET `value` = 1 WHERE `code` = 'ANYTHING` LIMIT 1;
```
Suggested fix:
Give the user a preference setting for safe mode.
Let the connection dialect be determined by the server, not the client.