I do not, and I will explain to you why. I had a very strange problem with MySQL.
Imagine you have a table named "table1" with one record. Column f1 has the value "A". Column f2 has the value "B"
Update table1 set f1 = CONCAT(f1,f2), f2 = 'C';
The final value of f1 is "AB" as expected.
But if you change the order:
Update table1 set f2 = 'C', f1 = CONCAT(f1,f2);
The final value of f1 is "AC". That is: f2 first changes, and after that f1.
My conclusion is that the update operation is clearly non-atomic. f2 first changes. f1 changes after using the updated value of f2, not the original one.
Rober2d2
source share