aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTing-Wei Lan <tingwei.lan@cobinhood.com>2019-03-26 17:42:02 +0800
committerlantw44 <lantw44@gmail.com>2019-03-29 18:40:42 +0800
commit0eec803b75830c0bef922fa4a4ba8dd0bb552360 (patch)
tree230a07bb5f741ed0dbb8a093ed2e8fbd5621586e
parent192453fe7c042000ffbd7d4ac160b1a98b6d0516 (diff)
downloaddexon-0eec803b75830c0bef922fa4a4ba8dd0bb552360.tar
dexon-0eec803b75830c0bef922fa4a4ba8dd0bb552360.tar.gz
dexon-0eec803b75830c0bef922fa4a4ba8dd0bb552360.tar.bz2
dexon-0eec803b75830c0bef922fa4a4ba8dd0bb552360.tar.lz
dexon-0eec803b75830c0bef922fa4a4ba8dd0bb552360.tar.xz
dexon-0eec803b75830c0bef922fa4a4ba8dd0bb552360.tar.zst
dexon-0eec803b75830c0bef922fa4a4ba8dd0bb552360.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 {