Bugs item #2819972, was opened at 2009-07-11 07:41
Message generated for change (Comment added) made by mlkersten
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2819972&group_id=56967
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: z lh (zlh)
Assigned to: Martin Kersten (mlkersten)
Summary: function problom ----return and elseif
Initial Comment:
create function test(a int) returns int
begin
if a>3
then return 1;
end if;
return 4;
end;
select test(4);
problem: can't return function, in if else statement, the expected result is 1
not 4
note: optimizer inline problem
create function te(a int) returns int
begin
declare b int;
set b=0;
if a>3
then set b= 1;
elseif a>2
then set b=2;
end if;
return b;
end;
select te(3);
+-----------------+
| te_single_value |
+=================+
| 0 |
+-----------------+
problem: return result not correct, the expected result is 2 not 0
----------------------------------------------------------------------
>Comment By: Martin Kersten (mlkersten)
Date: 2009-07-20 16:39
Message:
The code has now been protected against multiple short-cut exits in inlined
functions.
Such functions are never inlined.
----------------------------------------------------------------------
Comment By: Niels Nes (nielsnes)
Date: 2009-07-19 13:34
Message:
seems to be caused by the inline optimizer. It rewrites the return
statements incorrectly.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2819972&group_id=56967
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs