Sorry, that's the wrong way around. I should have said:
Your BEFORE UPDATE trigger could leave the "synced" value in NEW
alone if force_sync was **true**, and set "synced" to false
otherwise. It could then set NEW.force_sync to false, to leave you ready for the next update.
Thanks for your advice (and the patience on this list in general). Instead of using two columns, I now use an integer-column and set it to a value taken from an incrementing sequence.
Чтобы сделать работу с сайтом удобнее, мы используем cookie и аналитический сервис «Яндекс.Метрика». Продолжая пользоваться сайтом, вы соглашаетесь с их использованием.