Using "repeatable read" it should be possible to produce a phantom read, but how? I need it for an example teaching CS-students.
I think that I must make a "SELECT ... WHERE x<=888" on a non-indexed field x, with an upperlimit 888 not present, and then on another connection insert a new row with a value just below 888.
Except it doesn't work. Do I need a very large table? Or something else?
The "phantom read" in MySQL on RR isolation level is hidden deep, but still can reproduce it. Here are the steps:
create table ab(a int primary key, b int);
Tx1:
begin;
select * from ab; // empty set