提交 645aa1ab authored 作者: Thomas Mueller's avatar Thomas Mueller

use correct precision for mathematical functions

上级 4cd8cb51
...@@ -51,6 +51,7 @@ import org.h2.util.ObjectArray; ...@@ -51,6 +51,7 @@ import org.h2.util.ObjectArray;
import org.h2.util.ObjectUtils; import org.h2.util.ObjectUtils;
import org.h2.util.RandomUtils; import org.h2.util.RandomUtils;
import org.h2.util.StringUtils; import org.h2.util.StringUtils;
import org.h2.value.DataType;
import org.h2.value.Value; import org.h2.value.Value;
import org.h2.value.ValueArray; import org.h2.value.ValueArray;
import org.h2.value.ValueBoolean; import org.h2.value.ValueBoolean;
...@@ -1703,9 +1704,10 @@ public class Function extends Expression implements FunctionCall { ...@@ -1703,9 +1704,10 @@ public class Function extends Expression implements FunctionCall {
} }
default: default:
dataType = info.dataType; dataType = info.dataType;
DataType type = DataType.getDataType(dataType);
precision = 0; precision = 0;
displaySize = 0; displaySize = 0;
scale = 0; scale = type.defaultScale;
} }
if (allConst) { if (allConst) {
return ValueExpression.get(getValue(session)); return ValueExpression.get(getValue(session));
...@@ -1798,6 +1800,9 @@ public class Function extends Expression implements FunctionCall { ...@@ -1798,6 +1800,9 @@ public class Function extends Expression implements FunctionCall {
displaySize = (int) precision; displaySize = (int) precision;
break; break;
default: default:
DataType type = DataType.getDataType(dataType);
precision = type.defaultPrecision;
displaySize = type.defaultDisplaySize;
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论