-
-
Notifications
You must be signed in to change notification settings - Fork 221
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 after SINGULAR condition [CORE2965] #3347
Comments
Commented by: Sean Leyne (seanleyne) Please explain why you think the current result is incorrect. |
Commented by: Alex Kurov (alex.kurov) You can try another sql statement execute block And you'll see it does not return 1 as the example above So if subselect in singular condition doesn't return any dataset the ROW_COUNT variable stays unaffected. |
Commented by: @dyemanov ROW_COUNT means the number of records selected or modified by the SELECT, INSERT, UPDATE or DELETE clause. It is not intended to return number of records affected by sub-queries. |
Modified by: Sean Leyne (seanleyne)status: Open [ 1 ] => Resolved [ 5 ] resolution: Won't Fix [ 2 ] |
Commented by: Alex Kurov (alex.kurov) Ok. But as you can see from the second example - it does. It seems like row_count is equal to number of rows fetched from rdb$relation_fields (it is subselect) |
Commented by: @dyemanov You're right, we have some inconsistency here. The counter is reset for the every SELECT/UPDATE/etc statement, but incremented per every fetch, including sub-queries. I suggest to fix it by not incrementing the counter for sub-queries. |
Modified by: @dyemanovstatus: Resolved [ 5 ] => Reopened [ 4 ] assignee: Dmitry Yemanov [ dimitr ] resolution: Won't Fix [ 2 ] => |
Modified by: @dyemanovstatus: Reopened [ 4 ] => In Progress [ 3 ] |
Modified by: @dyemanovstatus: In Progress [ 3 ] => Open [ 1 ] |
Modified by: @dyemanovstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 2.5 RC3 [ 10381 ] Fix Version: 3.0 Alpha 1 [ 10331 ] |
Modified by: @pmakowskistatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Alex Kurov (alex.kurov)
Is related to QA437
Test case:
execute block
returns(rcount integer)
as
declare tmpint integer;
begin
select rdb$relation_id from rdb$database into tmpint;
if (SINGULAR(select rdb$relation_id from rdb$database where rdb$relation_id is null)) then begin end
rcount = row_count;
suspend;
end;
returns:
1
should return:
0
Commits: b29556c
The text was updated successfully, but these errors were encountered: