Comments - Trigger Overview

5 years ago Dennis Giese

Maybe good to know:

To check on an update trigger whether a column needs to be updated you can do old.value<>new.value as an if statement:

if old.value<>new.value then
 set new.value=whatever you need;
end if;

This even works on encrypted fields so you don't need to decrypt or encrypt values before comparing. It seems this is to be done by database itself "automatically".

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.