Issue Details (XML | Word | Printable)

Key: CORE-1605
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Dmitry Yemanov
Votes: 2
Watchers: 1
Operations

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

Bugcheck 232 (invalid operation) for an aggregated query

Created: 20/Nov/07 02:37 AM   Updated: 29/Mar/14 04:30 PM
Component/s: Engine
Affects Version/s: 2.0.0, 2.0.1, 2.1 Alpha 1, 2.1 Beta 1, 2.0.2, 2.0.3, 2.1 Beta 2
Fix Version/s: 3.0 Alpha 1

Time Tracking:
Not Specified

Issue Links:
Relate
 


 Description  « Hide
recreate table some_table (id int);

recreate procedure some_proc (id int)
  returns (result int)
as
begin
  result = 1;
  suspend;
end;

insert into some_table values (1);
commit;

select
    count(*),
    sum( (select result from some_proc(id)) )
from
    some_table
group by
    2

-- produces bugcheck 232 (invalid operation) instead of throwing a proper error

 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 - 14/Feb/11 10:20 AM
Adriano, hopefully you understand the DSQL internals better in order to fix that ;-)

leonon added a comment - 11/Dec/12 08:21 AM - edited
Hello!

Server WI-V6.3.2.26539 Firebird 2.5
Client 2.5.2.26539

Example:

CREATE TABLE TEST1 (
    ID INTEGER NOT NULL,
    BALANCE DOUBLE PRECISION
);

ALTER TABLE TEST1 ADD CONSTRAINT PK_TEST1 PRIMARY KEY (ID);

SET TERM ^ ;

create or alter procedure S_TEST1 (
    I_ID integer)
returns (
    O_BALANCE double precision)
as
begin
  select T.BALANCE
  from TEST1 T
  where T.ID = :I_ID
  into O_BALANCE;

  O_BALANCE = coalesce(O_BALANCE, 0);

  suspend;
end^

SET TERM ; ^

GRANT SELECT ON TEST1 TO PROCEDURE S_TEST1;

Generating random test data (50,000 records)

When run the query:

select t.id,
       sum((select O_BALANCE from s_test1(t.ID)))
from test1 t
group by 1, 2

server is shut down with error:
internal Firebird consistency check (EVL_expr: invalid operation (232), file: evl.cpp line: 1207)

Adriano dos Santos Fernandes added a comment - 11/Dec/12 01:52 PM
This was fixed in some now unknown commit.