Issue Details (XML | Word | Printable)

Key: CORE-2117
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Adriano dos Santos Fernandes
Votes: 0
Watchers: 0
Operations

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

Incorrect ROW_COUNT value with indexed retrieval and subquery

Created: 11/Oct/08 12:21 PM   Updated: 26/Jan/09 08:29 AM
Component/s: Engine
Affects Version/s: 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.5 Initial, 2.1.0, 2.0.4, 2.5 Alpha 1, 2.1.1
Fix Version/s: 2.1.2, 2.5 Beta 1

Time Tracking:
Not Specified

Issue Links:
Relate
 

Planning Status: Unspecified


 Description  « Hide
Test case:

create table t (n integer);

insert into t values (1);
insert into t values (2);
insert into t values (3);

commit;

create index t_n on t (n);

set term !;

execute block returns (n integer)
as
  declare x integer;
begin
  update t set n = n where n = -1;
  n = row_count;
  suspend;

  update t set n = n where n = (select -1 from rdb$database);
  n = row_count;
  suspend;

  update t set n = n where n = -1;
  n = row_count;
  suspend;

  for select 1 from t where n = -1 into x do
  begin
  end
  n = row_count;
  suspend;

  for select 1 from t where n = (select -1 from rdb$database) into x do
  begin
  end
  n = row_count;
  suspend;

  delete from t where n = (select -1 from rdb$database);
  n = row_count;
  suspend;
end!

set term ;!

Returns:
0
1
0
0
1
1

Should return:
0
0
0
0
0
0


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.