On 20/03/2024 13:37, 'Dimitry Sibiryakov' via firebird-support wrote:
> 'Mark Rotteveel' via firebird-support wrote 20.03.2024 13:30:
>> There is behaviour which the standard requires (i.e. FOR UPDATE
>> checking if the resulting cursor would actually be updatable and
>> positioned updates and deletes only working on updatable cursors)
>
> Ok, but I have no copy of standard so I cannot check how it defines
> "updatable cursor". I suspect that it could be "cursor that can be used
> in UPDATE statement" but Firebird does not implement updating of
> cursors. What it implements is updating of tables behind cursors.
>
>> and other things you could do instead (updates using a row-key like
>> RDB$DB_KEY).
>
> Not "you could do", it is how Firebird implements it.
Again, your conflating things here. The fact that Firebird implements
positioned updates/deletes by using RDB$DB_KEY is an implementation
detail, it doesn't mean it can simply flaunt the requirements of the SQL
standard when implementing things specified by the standard.
So when a statement uses WHERE CURRENT OF ..., it should follow the
standard requirements which checks if the cursor is actually updatable,
while on the other hand, if a statement uses WHERE RDB$DB_KEY = ... it
doesn't need to do so.
>> The Firebird behaviour of disabling buffering with FOR UPDATE is
>> pretty much outside the standard (but needed for correct positioned
>> updates).
>
> Just another implementation detail, nothing more.
Given the standard specifies that FOR UPDATE is implied *if* the query
is simply updatable, Firebird falls foul of that by doing something
extra if you do specify it explicitly (and instead fails to do what the
standard does require, namely requiring that the cursor is actually
updatable).
Sure, with over 25 years of history, that is no longer something that
can be removed, but it is not compliant.
Mark
--
Mark Rotteveel