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

constraints on sp output parameters are checked even when the sp returns zero rows [CORE2204] #2632

Closed
firebird-automations opened this issue Nov 20, 2008 · 12 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Cosmin Apreutesei (cosmin_ap2)

Is duplicated by CORE2839
Is duplicated by CORE3751
Is related to CORE4184
Is related to QA541

CREATE DOMAIN BOOLEAN AS INTEGER NOT NULL CHECK (value = 0 or value = 1);
CREATE PROCEDURE TEST returns (b boolean)
as
begin
if (1 = 0) then
suspend;
end;

select * from test

The select throws "validation error for variable B, value *** null ***".

The answer is correct for execute procedure test returning b into x but not for select from test.

Commits: c268c1f

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

Cosmin, I believe that the functionality is working exactly as intended, null does not meet the domain check, as such the value is not allowed.

@firebird-automations
Copy link
Collaborator Author

Commented by: Cosmin Apreutesei (cosmin_ap2)

The procedure does not return any records. How can a domain check be applied where there is no value to apply to? Does that make any sense?

Theory aside, the practical implication is that I now have to uselessly initialize all my output parameters regardless whether the proc ever returns any records or not.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Output parameters (when not initialized) are validated at procedure end or suspending.

If no value is returned, looks like a bug for me if they are validated.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue is duplicated by CORE2839 [ CORE2839 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue is duplicated by CORE3751 [ CORE3751 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue is related to CORE4184 [ CORE4184 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA541 [ QA541 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

@firebird-automations
Copy link
Collaborator Author

Commented by: @pcisar

Test created.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

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

No branches or pull requests

2 participants