create table in mysql and postgresql. create table repeatable_read (id integer primary key,text varchar(200));
insert a new data in repeatable_read; insert into repeatable_read values(1,’first’);
mysql | session 1 | session 2 | | — | — | | insert into repeatable_read values(1,’first’); | | | | select * from repeatable_read; result:(1,’first’) | | start transaction; | | | | start transaction; | | update repeatable_read set text = ‘second’ where id = 1; | | | select * from repeatable_read; result:(1,’second’) | select * from repeatable_read; result:(1,’first’) | | commit; | | | | update repeatable_read set text = ‘third’ where id = 1;| | select * from repeatable_read; result:(1,’second’) | select * from repeatable_read; result:(1,’third’) | | | commit; | | select * from repeatable_read; result:(1,’third’) | select * from repeatable_read; result:(1,’third’) |