MySQL 9.0 Release Notes
If you access a column from the table to be updated in an
expression, UPDATE
uses the
current value of the column. The second assignment in the
following statement sets col2
to the
current (updated) col1
value, not the
original col1
value. The result is that
col1
and col2
have the
same value. This behavior differs from standard SQL.
UPDATE t1 SET col1 = col1 + 1, col2 = col1;