Reputation: 460
Is it possible to set a rule in MariaDB to stop execution of update query without where clause? Like mariadb can stop insert of a record if it doesn't satisfy a foreign key constraint.
I am using Mariadb 10.1.
Upvotes: 0
Views: 297
Reputation: 3987
The variable name is sql_safe_updates
. It can be set at runtime on session or global level:
-- for the current session
SET SESSION sql_safe_updates = ON;
-- for future sessions
SET GLOBAL sql_safe_updates = ON;
Upvotes: 2