You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Behaviour about a where statement with static content have change from Firebird 1.5/2.1 to 2.5 and have a massiv impact in our case. The static statement like (select sValue From spr_test('SIMSIM')) is evaluated 1 time in firebird 1.5 and 2.1, the number of row in the from-clause with firebird 2.5 (about 45'000 in our case).
You can test it with the following script:
-------------------------------------------------------------------------------
-- Init
-------------------------------------------------------------------------------
Create Table tt_table(Field1 varchar(100));
go
Create Or Alter PROCEDURE SPR_TEST (pName Varchar(2000)) RETURNS (sValue Varchar(255)) AS
BEGIN
Insert Into tt_table(field1) values(:pName);
sValue=:pName;
suspend;
End
go
-------------------------------------------------------------------------------
-- Call procedure
-------------------------------------------------------------------------------
Select count(*)
from rdb$types
where rdb$field_name like (select sValue From spr_test('SIMSIM'))
go
-------------------------------------------------------------------------------
-- Result is 1 with Firebird 1.5 and 2.1, 225 with Firebird 2.5
-------------------------------------------------------------------------------
Select count(*) From tt_table
go
-------------------------------------------------------------------------------
-- Clean
-------------------------------------------------------------------------------
Drop Procedure spr_test
go
Drop Table tt_table
go
Thank you for your big work with Firebird, its a very good thing!
assignee: Adriano dos Santos Fernandes [ asfernandes ]
summary: The Behaviour about a where statement with static content have change from Firebird 1.5/2.1 to 2.5 and have a massiv impact in our case => Invariant sub-query is treated as variant thus causing multiple invokations of a nested stored procedure
Submitted by: Jean-Baptiste Simmen (jb.simmen)
Is related to QA452
The Behaviour about a where statement with static content have change from Firebird 1.5/2.1 to 2.5 and have a massiv impact in our case. The static statement like (select sValue From spr_test('SIMSIM')) is evaluated 1 time in firebird 1.5 and 2.1, the number of row in the from-clause with firebird 2.5 (about 45'000 in our case).
You can test it with the following script:
-------------------------------------------------------------------------------
-- Init
-------------------------------------------------------------------------------
Create Table tt_table(Field1 varchar(100));
go
Create Or Alter PROCEDURE SPR_TEST (pName Varchar(2000)) RETURNS (sValue Varchar(255)) AS
BEGIN
Insert Into tt_table(field1) values(:pName);
sValue=:pName;
suspend;
End
go
-------------------------------------------------------------------------------
-- Call procedure
-------------------------------------------------------------------------------
Select count(*)
from rdb$types
where rdb$field_name like (select sValue From spr_test('SIMSIM'))
go
-------------------------------------------------------------------------------
-- Result is 1 with Firebird 1.5 and 2.1, 225 with Firebird 2.5
-------------------------------------------------------------------------------
Select count(*) From tt_table
go
-------------------------------------------------------------------------------
-- Clean
-------------------------------------------------------------------------------
Drop Procedure spr_test
go
Drop Table tt_table
go
Thank you for your big work with Firebird, its a very good thing!
Commits: 1120684 8f20258 FirebirdSQL/fbt-repository@13a7c38
The text was updated successfully, but these errors were encountered: