MySQL – Are Queries Called Parallel or in Sequence?

MySQL

Given this table:

id | field
----------
 1 |   2

Would it be possible that the column field is only incremented once, if two processes run in parallel this query:

UPDATE table SET field = field + 1 WHERE id = 1

In other words, if the above query would be executed twice, would it be possible to end up with the following database?

id | field
----------
 1 |   3

I searched at https://dev.mysql.com/doc/refman/8.0/en/innodb-locking.html but I was not able to find an answer there.

Best Answer

With autocommit = ON, the two queries will run one after the other.

With

BEGIN;
some stuff
that UPDATE 
more stuff
ROLLBACK; -- either explicitly, or because of some error

the UPDATE will be undone.

Check for errors after every query.

(If this does not suffice, please provide more info.)