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

Hidden variables conflict with output parameters, causing assertions, unexpected errors or possibly incorrect results [CORE2341] #2765

Closed
firebird-automations opened this issue Feb 24, 2009 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @dyemanov

Is related to QA391

Test case:

execute block (i varchar(10) = :a) returns (o varchar(10))
as
begin
o = coalesce(cast(o as date), current_date);
o = i;
suspend;
end

If called with an input parameter e.g. 'asd', it throws a conversion error instead of returning 'asd'.

The problem is caused by a hidden variable overwriting the output parameter node, as they mistakenly share the same BLR variable identifier.

Commits: 28aa57f

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Reason was execute block leaking variable numbers for input parameters, and hidden variables code not assuming this. Code was changed as the stored procedure, not incrementing "locals" variable.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 2.5 Beta 1 [ 10251 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA391 [ QA391 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pcisar

QA test added.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@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
Projects
None yet
Development

No branches or pull requests

2 participants