Just replying to my own message again. I didn't say what I think will happen
to this bug, with transactions implemented. Here is my current
understanding:
A B
SELECT
SELECT
BEGIN
BEGIN
INSERT
INSERT waits for lock...
UPDATE ...
...
COMMIT ...
INSERT returns
UPDATE
COMMIT
So the end result is exactly the same. The danger period is still the
duration of the INSERT plus part of the UPDATE.
-- Tim Starling <tstarlingphysicsunimelbeduau>