When issuing an UPDATE statement in MySQL (using InnoDB and the REPEATABLE READ isolation level) containing a subquery like this:
UPDATE bar INNER JOIN (SELECT i1, i2 FROM foo) inner
ON bar.b1 = inner.i1
SET bar.b2 = inner.i2)
Will the InnoDB engine lock only all affected rows from the bar
table, or will all accessed rows in the foo
table be (shared or exclusively) locked as well for the duration of the entire query?
Is there any difference for JOINs instead of subqueries?