Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invariant sub-query is treated as variant thus causing multiple invokations of a nested stored procedure [CORE3306] #3673

Closed
firebird-automations opened this issue Jan 9, 2011 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

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

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

This is a regression introduced when fixing CORE2893.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5.1 [ 10333 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA452 [ QA452 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

status: Resolved [ 5 ] => Closed [ 6 ]

Fix Version: 3.0 Alpha 1 [ 10331 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: Done successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants