Subject Re: [Firebird-Architect] the insert into t select * from t infinite
Author Ann W. Harrison
> "Jim Starkey" <jas@...> wrote:
>>The problem is, in fact, quite simple, and Ann has sketched the
>>solution. All that is necessary is to track the record numbers of newly
>>inserted records so the outer select can ignore them.
Dmitry Yemanov wrote:
> This is not as simple. Updates and deletes are also affected by this issue.
> We cannot just track the records and ignore them.

OK, not ignore them completely - the records are stored in the database
in the completely normal way. The insert case is simple - the
subselect that drives an insert ignores records that appear on the undo
list of the insert. Update and delete are slightly more complicated.
For those verbs, the subselect recognized that it must use the next
older version of records that appear on the undo list for the update or

> They're required to be
> partially reconstructed using the undo log to represent the state of the
> record at the moment of the remembered savepoint. And I really doubt that
> RSE is a proper place for that.

Not RSE - record selection expression, RSB - record source block. Quite
a different animal. Sorry about the TLA's - they seemed like a good
idea at the time.