提交 86c59286 authored 作者: noelgrandin's avatar noelgrandin

Because of how we are storing the min-max-flag in the read/write method the no.…

Because of how we are storing the min-max-flag in the read/write method the no. of dimensions must be <= 31.
上级 8932f213
...@@ -13,7 +13,7 @@ import org.h2.mvstore.WriteBuffer; ...@@ -13,7 +13,7 @@ import org.h2.mvstore.WriteBuffer;
import org.h2.mvstore.type.DataType; import org.h2.mvstore.type.DataType;
/** /**
* A spatial data type. This class supports up to 255 dimensions. Each dimension * A spatial data type. This class supports up to 31 dimensions. Each dimension
* can have a minimum and a maximum value of type float. For each dimension, the * can have a minimum and a maximum value of type float. For each dimension, the
* maximum value is only stored when it is not the same as the minimum. * maximum value is only stored when it is not the same as the minimum.
*/ */
...@@ -22,9 +22,11 @@ public class SpatialDataType implements DataType { ...@@ -22,9 +22,11 @@ public class SpatialDataType implements DataType {
private final int dimensions; private final int dimensions;
public SpatialDataType(int dimensions) { public SpatialDataType(int dimensions) {
// Because of how we are storing the min-max-flag in the read/write method
// the no. of dimensions must be < 32.
DataUtils.checkArgument( DataUtils.checkArgument(
dimensions >= 1 && dimensions < 256, dimensions >= 1 && dimensions < 32,
"Dimensions must be between 1 and 255, is {0}", dimensions); "Dimensions must be between 1 and 31, is {0}", dimensions);
this.dimensions = dimensions; this.dimensions = dimensions;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论