A documentation for MySQL 5.6 regarding REPEATABLE READ isolation level states:
This means that if you issue several plain (nonlocking) SELECT statements within the same transaction, these SELECT statements are consistent also with respect to each other.
Does reverse (somewhat) guarantee also holds? I.e. does any record which was not read yet, will be the newest version of itself? What I'm actually trying to understand, is whether in MySQL there is a possibility to have a race condition in data fetched between starting a transaction and aquiring a lock (SELECT ... FOR UPDATE)?
Example:
Transaction 1 Transaction 2
begin
begin
select id from shops where id = 1
update shops where name = 'something new'
select id, name from shops where id = 1
(waiting for lock)
...
commit
???
Is there a guarantee which tells me that in the end, in ??? place, transaction 1 will surely see name equal being to something? Source in documentation would be much appreciated (for now I've just checked manually with two db sessions that it "seems to work").