Skip to content

Different gdscode in 3.0 vs 2.5 when lock conflict occurs [CORE4473] #4793

@firebird-automations

Description

@firebird-automations

Submitted by: @pavel-zotov

Consider following script in which lock conflict between two transactions occur (the 'main' Tx locking record and autonomous Tx trying to lock the same row and get lock conflict exception; gdscode of this exception will be displayed as result of the script):

show version;
show database;
recreate table t(id int, x int);
commit;
insert into t values(1, 100);
commit;
set transaction read committed no wait;

update t set x=-x order by id rows 1;

set term ^;
execute block returns(new_x int, gds_code int) as
begin
in autonomous transaction do
begin
update t set x=x*2 order by id rows 1 returning x into new_x;
when any do
begin
gds_code = gdscode;
end
end
suspend;
end
^ set term ;^
quit;

Test-1 (on FB 2.5): isql 192.168.0.220/3253:/var/db/fb25/tmp25.fdb -i lck_code.sql
Result:
ISQL Version: WI-V2.5.3.26730 Firebird 2.5
Server version:
Firebird/linux AMD64 (access method), version "LI-V2.5.3.26744 Firebird 2.5"
Firebird/linux AMD64 (remote server), version "LI-V2.5.3.26744 Firebird 2.5/tcp (oel64)/P12"
Firebird/x86/Windows NT (remote interface), version "WI-V2.5.3.26730 Firebird 2.5/tcp (csprog)/P12"
on disk structure version 11.2
Database: 192.168.0.220/3253:/var/db/fb25/tmp25.fdb
Owner: SYSDBA
PAGE_SIZE 4096
Number of DB pages allocated = 169
Sweep interval = 20000
Forced Writes are ON
Transaction - oldest = 15
Transaction - oldest active = 16
Transaction - oldest snapshot = 16
Transaction - Next = 20
ODS = 11.2
Default Character set: NONE

   NEW\_X     GDS\_CODE 

============ ============
<null> 335544345

Test-2 (on Fb 3.0): isql 192.168.0.220/3333:/var/db/fb30/tmp30.fdb -i lck_code.sql
Result:
ISQL Version: WI-V2.5.3.26730 Firebird 2.5
Server version:
Firebird/linux AMD64 (access method), version "LI-T3.0.0.31193 Firebird 3.0 Alpha 2"
Firebird/linux AMD64 (remote server), version "LI-T3.0.0.31193 Firebird 3.0 Alpha 2/tcp (oel64)/P12"
Firebird/x86/Windows NT (remote interface), version "WI-V2.5.3.26730 Firebird 2.5/tcp (csprog)/P12"
on disk structure version 12.0
Database: 192.168.0.220/3333:/var/db/fb30/tmp30.fdb
Owner: SYSDBA
PAGE_SIZE 4096
Number of DB pages allocated = 228
Sweep interval = 20000
Forced Writes are ON
Transaction - oldest = 4
Transaction - oldest active = 5
Transaction - oldest snapshot = 5
Transaction - Next = 9
ODS = 12.0
Default Character set: NONE

   NEW\_X     GDS\_CODE 

============ ============
<null> 335544336

Why gdscode differs for the same script (335544345 in 2.5 and 335544336 in 3.0) ?

PS. I'm not sure that this is bug, but couldn`t find variant like 'strangeness' in the list when creating this issue :-)

====== Test Details ======

See test for CORE5555.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions