Subject Re: [Firebird-Architect] the insert into t select * from t infinite loop
Author Vlad Horsun
> > Could we find a fix for that problem by identifying statements that
> > might be susceptible - including obscurities like:
> >
> > insert into t select * from a
> > where a.t_val in (select t_val from t)
> >
> > and checking somewhere that the input values aren't dependent on a
> > record that's listed in the verb undo log?
>
> This doesn't fix this problem:
>
> SELECT
> *
> FROM
> TableX x
> WHERE
> x.ID IN (SELECT FIRST 5 y.ID FROM TableY)
>
> Which is the same problem IMO.

No, there are one more problem - INSERT provided by Ann in the
subject will loop infinite since SELECT can see new inserted records
and never stops.

As i understand - Ann proposed to check current savepoint in undo
log for records found by SELECT - i.e. SELECT will see "prior version"
of found on disk record. For INSERT there will be no such "prior version"
in current verb so SELECT can stop.

Regards,
Vlad