This problem was originally reported by Jerome B. on the maria-developers list on 2017-07-21:
produces this result:
Other databases return 2 for all columns:
MariaDB's behavior contradicts the SQL standard, which says in the section <update statement: searched>:
10) The <update source> of each <set clause> contained in SCL is effectively evaluated for each row of T before any row of T is updated.