aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTing-Wei Lan <tingwei.lan@cobinhood.com>2019-03-26 17:42:02 +0800
committerJhih-Ming Huang <jm.huang@cobinhood.com>2019-04-11 10:39:59 +0800
commitd2f8e0c53394c131280c1375e0c28d6185209a45 (patch)
tree0ff882d709d52466df7b09be8e3b46dc1a1c4524
parent5c45e7a10bc363f43b43a01ebd9b7093eee9f53c (diff)
downloaddexon-d2f8e0c53394c131280c1375e0c28d6185209a45.tar
dexon-d2f8e0c53394c131280c1375e0c28d6185209a45.tar.gz
dexon-d2f8e0c53394c131280c1375e0c28d6185209a45.tar.bz2
dexon-d2f8e0c53394c131280c1375e0c28d6185209a45.tar.lz
dexon-d2f8e0c53394c131280c1375e0c28d6185209a45.tar.xz
dexon-d2f8e0c53394c131280c1375e0c28d6185209a45.tar.zst
dexon-d2f8e0c53394c131280c1375e0c28d6185209a45.zip
core: vm: sqlvm: schema: move methods of DataTypeMajor
We will add more methods to DataType.
-rw-r--r--core/vm/sqlvm/ast/types.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/core/vm/sqlvm/ast/types.go b/core/vm/sqlvm/ast/types.go
index 3909e7575..c37e6c012 100644
--- a/core/vm/sqlvm/ast/types.go
+++ b/core/vm/sqlvm/ast/types.go
@@ -68,6 +68,16 @@ func ComposeDataType(major DataTypeMajor, minor DataTypeMinor) DataType {
return (DataType(major) << 8) | DataType(minor)
}
+// IsFixedRange checks if major is in range of DataTypeMajorFixed.
+func (d DataTypeMajor) IsFixedRange() bool {
+ return d >= DataTypeMajorFixed && d-DataTypeMajorFixed <= 0x1f
+}
+
+// IsUfixedRange checks if major is in range of DataTypeMajorUfixed.
+func (d DataTypeMajor) IsUfixedRange() bool {
+ return d >= DataTypeMajorUfixed && d-DataTypeMajorUfixed <= 0x1f
+}
+
// Size return the bytes of the data type occupied.
func (dt DataType) Size() uint8 {
major, minor := DecomposeDataType(dt)
@@ -91,16 +101,6 @@ func (dt DataType) Size() uint8 {
}
}
-// IsFixedRange checks if major is in range of DataTypeMajorFixed.
-func (d DataTypeMajor) IsFixedRange() bool {
- return d >= DataTypeMajorFixed && d-DataTypeMajorFixed <= 0x1f
-}
-
-// IsUfixedRange checks if major is in range of DataTypeMajorUfixed.
-func (d DataTypeMajor) IsUfixedRange() bool {
- return d >= DataTypeMajorUfixed && d-DataTypeMajorUfixed <= 0x1f
-}
-
// DataTypeEncode encodes data type node into DataType.
func DataTypeEncode(n TypeNode) (DataType, error) {
if n == nil {