提交 b80fcd53 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Remove ValueLong.MIN_BD and use Value.MIN_LONG_DECIMAL instead

上级 ddf9c813
...@@ -3259,7 +3259,7 @@ public class Parser { ...@@ -3259,7 +3259,7 @@ public class Parser {
r = ValueExpression.get(ValueInt.get(Integer.MIN_VALUE)); r = ValueExpression.get(ValueInt.get(Integer.MIN_VALUE));
} else if (r.getType() == Value.DECIMAL && } else if (r.getType() == Value.DECIMAL &&
r.getValue(session).getBigDecimal() r.getValue(session).getBigDecimal()
.compareTo(ValueLong.MIN_BD) == 0) { .compareTo(Value.MIN_LONG_DECIMAL) == 0) {
// convert Long.MIN_VALUE to type 'long' // convert Long.MIN_VALUE to type 'long'
// (Long.MAX_VALUE+1 is of type 'decimal') // (Long.MAX_VALUE+1 is of type 'decimal')
r = ValueExpression.get(ValueLong.MIN); r = ValueExpression.get(ValueLong.MIN);
......
...@@ -182,7 +182,11 @@ public abstract class Value { ...@@ -182,7 +182,11 @@ public abstract class Value {
private static SoftReference<Value[]> softCache; private static SoftReference<Value[]> softCache;
private static final BigDecimal MAX_LONG_DECIMAL = private static final BigDecimal MAX_LONG_DECIMAL =
BigDecimal.valueOf(Long.MAX_VALUE); BigDecimal.valueOf(Long.MAX_VALUE);
private static final BigDecimal MIN_LONG_DECIMAL =
/**
* The smallest Long value, as a BigDecimal.
*/
public static final BigDecimal MIN_LONG_DECIMAL =
BigDecimal.valueOf(Long.MIN_VALUE); BigDecimal.valueOf(Long.MIN_VALUE);
/** /**
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
*/ */
package org.h2.value; package org.h2.value;
import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.SQLException; import java.sql.SQLException;
...@@ -33,11 +32,6 @@ public class ValueLong extends Value { ...@@ -33,11 +32,6 @@ public class ValueLong extends Value {
*/ */
public static final BigInteger MAX_BI = BigInteger.valueOf(Long.MAX_VALUE); public static final BigInteger MAX_BI = BigInteger.valueOf(Long.MAX_VALUE);
/**
* The smallest Long value, as a BigDecimal.
*/
public static final BigDecimal MIN_BD = BigDecimal.valueOf(Long.MIN_VALUE);
/** /**
* The precision in digits. * The precision in digits.
*/ */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论