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 execution of volatile SQL statements inside EXECUTE STATEMENT [CORE2920] #3303

Closed
firebird-automations opened this issue Mar 12, 2010 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @dyemanov

Is related to QA434

Test case:

recreate table bugtest (id int)
insert into bugtest (id) values (123)

recreate procedure p_bugtest (in_id int)
returns (cnt int)
as
declare predicate varchar(1000);
begin
if (:in_id is null) then
predicate = ' ? is null';
else
predicate = ' id = ?';

execute statement ('select count(*) from bugtest where' || predicate) (:in_id)
into :cnt;
end

execute procedure p_bugtest (123)
-- cnt = 1
execute procedure p_bugtest (null)
-- cnt = 1
execute procedure p_bugtest (123)
-- cnt = 0 !!!

Commits: fd04d5f 1ef4fd6

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Vlad Khorsun [ hvlad ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

Fix Version: 2.5 RC3 [ 10381 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA434 [ QA434 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

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