提交 ac03ba32 authored 作者: Thomas Mueller's avatar Thomas Mueller

ABS(CAST(0.0 AS DOUBLE)) returned -0.0 instead of 0.0.

上级 3e1cb1af
......@@ -21,6 +21,8 @@ Change Log
<h2>Next Version (unreleased)</h2>
<ul>
<li>ABS(CAST(0.0 AS DOUBLE)) returned -0.0 instead of 0.0.
</li>
<li>BNF auto-completion failed with unquoted identifiers.
</li>
<li>Oracle compatibility: empty strings were not converted to NULL when using prepared statements.
......
......@@ -581,7 +581,7 @@ public class Function extends Expression implements FunctionCall {
Value result;
switch (info.type) {
case ABS:
result = v0.getSignum() > 0 ? v0 : v0.negate();
result = v0.getSignum() >= 0 ? v0 : v0.negate();
break;
case ACOS:
result = ValueDouble.get(Math.acos(v0.getDouble()));
......
......@@ -3,6 +3,12 @@
-- Initial Developer: H2 Group
--
--- special grammar and test cases ---------------------------------------------------------------------------------------------
select abs(cast(0.0 as double)) x;
> X
> ---
> 0.0
> rows: 1
select * from table(a int=(1)), table(b int=(2));
> A B
> - -
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论