EACH ROW BEGIN IF (NEW.email IS NOT NULL) THEN SET NEW.email = MD5(concat(NEW.email,'長い塩')); END IF; END; CREATE TRIGGER users_update BEFORE UPDATE ON users FOR EACH ROW BEGIN IF (NEW.email IS NOT NULL AND NEW.email !=ifnull(OLD.email, '')) THEN SET NEW.email = MD5(concat(NEW.email,'長い塩')); END IF; END; $$