Is this “compare and replace” operator always an atom independent of the engine (for example, InnoDB or MyISAM)?
UPDATE tbl_name SET locked=1 WHERE id=ID AND locked <> 1;
I ask for this because I intend to use this statement to lock at the row level, compatible with both transactional and transactional database tables.
This is the recommended method for MyISAM , but I'm not sure if this works for InnoDB, as the documentation suggests using transactions instead.
source share