I had hoped that the SQL improvements would fix this annoyance, but according to the documentation they did not:<p><pre><code> create table fib ( a integer, b integer );
insert into fib (a, b) values (1, 0);
update fib set a=a+b, b=a;
update fib set a=a+b, b=a;
update fib set a=a+b, b=a;
update fib set a=a+b, b=a;
update fib set a=a+b, b=a;
select a, b from fib;
</code></pre>
The correct result according to the SQL standard is a == 8 and b == 5. In MySQL the result is a == 16 and b == 16. They do document this in the manual, saying UPDATE evaluates the assignments left to write, and note that this deviates from the standard.<p>MariaDB is the same prior to 10.3.5. Starting with 10.3.5 it defaults to left to write evaluation, but you can set the SIMULTANEOUS_ASSIGNMENT mode flag to make UPDATE evaluate the assignments simultaneously instead of left to right.<p>I believe that all other common SQL databases (Sqlite, PostgreSQL, Oracle, Microsoft SQL Server) follow the standard.