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-issue-importer opened this issue Nov 20, 2008 · 12 comments

Comments

@firebird-issue-importer

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-issue-importer
Copy link
Author

firebird-issue-importer commented Nov 20, 2008

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Nov 20, 2008

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-issue-importer
Copy link
Author

firebird-issue-importer commented Nov 20, 2008

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-issue-importer
Copy link
Author

firebird-issue-importer commented Nov 20, 2008

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-issue-importer
Copy link
Author

firebird-issue-importer commented Feb 1, 2010

Modified by: @asfernandes

Link: This issue is duplicated by CORE2839 [ CORE2839 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Dec 5, 2010

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Feb 2, 2012

Modified by: @asfernandes

Link: This issue is duplicated by CORE3751 [ CORE3751 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 20, 2013

Modified by: @asfernandes

Link: This issue is related to CORE4184 [ CORE4184 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Mar 29, 2014

Modified by: @pcisar

Link: This issue is related to QA541 [ QA541 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 28, 2015

Modified by: @pavel-zotov

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

QA Status: Done successfully

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 25, 2015

Commented by: @pcisar

Test created.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 25, 2015

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