I'm building an App and using MariaDB as my database. I have a table "kick_votes". Its primary key consits of three fields:
- user_id
- group_id
- vote_id
I need to delete rows where user_id AND group_id fulfill my conditions or just the vote_id. I enabled the config, that I have to use a key column in my WHERE clause for security issues.
This one is working correctly:
DELETE FROM kick_votes WHERE (user_id=86 AND group_id=10);
DELETE FROM kick_votes WHERE vote_id=2;
But I don't want to use two statements, but the following doesn't work:
DELETE FROM kick_votes WHERE (user_id=86 AND group_id=10) OR vote_id=2;
I get the error:
You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column.
Why isn't it working?