Issue Details (XML | Word | Printable)

Key: CORE-3306
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Jean-Baptiste Simmen
Votes: 0
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Invariant sub-query is treated as variant thus causing multiple invokations of a nested stored procedure

Created: 09/Jan/11 06:03 PM   Updated: 04/Jun/13 12:24 PM
Component/s: Engine
Affects Version/s: 2.5.0
Fix Version/s: 2.5.1

Time Tracking:
Not Specified

Environment: Found and Tested on MS Windows XP (Firebird-2.5.0.26074_1_Win32) and Server 2008 (Firebird-2.5.0.26074_1_x64 )
Issue Links:
Relate
 

Planning Status: Unspecified


 Description  « Hide
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!



 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dmitry Yemanov added a comment - 10/Jan/11 10:17 AM
This is a regression introduced when fixing CORE-2893.