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

Incorrect ROW_COUNT value with indexed retrieval and subquery [CORE2117] #2549

Closed
firebird-automations opened this issue Oct 11, 2008 · 9 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @asfernandes

Is related to QA226

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

Commits: 2223e6a 0793554

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

description: 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

=>

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 2.1.2 [ 10270 ]

Fix Version: 2.5 Beta 1 [ 10251 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

Link: This issue block progress on QA226 [ QA226 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA226 [ QA226 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue block progress on QA226 [ QA226 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test => Done successfully

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