aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTing-Wei Lan <tingwei.lan@cobinhood.com>2019-03-13 17:59:36 +0800
committerJhih-Ming Huang <jm.huang@cobinhood.com>2019-04-11 10:39:59 +0800
commit23a8d53d37e78cb69949963c957fddf6683ad3a7 (patch)
treebde2c7e63adfdcd57855795906af5d5d8e22ea23
parentf0f86cc530b6a31b076dc71657951eb8167426b0 (diff)
downloaddexon-23a8d53d37e78cb69949963c957fddf6683ad3a7.tar
dexon-23a8d53d37e78cb69949963c957fddf6683ad3a7.tar.gz
dexon-23a8d53d37e78cb69949963c957fddf6683ad3a7.tar.bz2
dexon-23a8d53d37e78cb69949963c957fddf6683ad3a7.tar.lz
dexon-23a8d53d37e78cb69949963c957fddf6683ad3a7.tar.xz
dexon-23a8d53d37e78cb69949963c957fddf6683ad3a7.tar.zst
dexon-23a8d53d37e78cb69949963c957fddf6683ad3a7.zip
core: vm: sqlvm: schema: add structs to identify an object in a schema
These structs will be used in identifier nodes to store references to objects defined in the schema or the command itself.
-rw-r--r--core/vm/sqlvm/schema/schema.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/core/vm/sqlvm/schema/schema.go b/core/vm/sqlvm/schema/schema.go
index 7bbe9518e..e3e695663 100644
--- a/core/vm/sqlvm/schema/schema.go
+++ b/core/vm/sqlvm/schema/schema.go
@@ -71,6 +71,9 @@ type IndexRef uint8
// SequenceRef defines the type for sequence index in Table.
type SequenceRef uint8
+// SelectColumnRef defines the type for column index in SelectStmtNode.Column.
+type SelectColumnRef uint16
+
// IndexAttr defines bit flags for describing index attribute.
type IndexAttr uint16
@@ -198,3 +201,26 @@ func (c *Column) DecodeRLP(s *rlp.Stream) error {
return nil
}
+
+// TableDescriptor identifies a table in a schema by an array index.
+type TableDescriptor struct {
+ Table TableRef
+}
+
+// ColumnDescriptor identifies a column in a schema by array indices.
+type ColumnDescriptor struct {
+ Table TableRef
+ Column ColumnRef
+}
+
+// IndexDescriptor identifies a index in a schema by array indices.
+type IndexDescriptor struct {
+ Table TableRef
+ Index IndexRef
+}
+
+// SelectColumnDescriptor identifies a column specified in a select command by
+// an array index.
+type SelectColumnDescriptor struct {
+ SelectColumn SelectColumnRef
+}