You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
The text was updated successfully, but these errors were encountered: