aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/sqlvm
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-05-06 10:44:04 +0800
commit28b9792f69bcb0863d83d0045038712f31a80db4 (patch)
tree9e4a631dcdb3eedddbc491c8ec436f242b1994eb /core/vm/sqlvm
parent683a90aa4b2f5788ca7eb8554d35c333e5bef08f (diff)
downloaddexon-28b9792f69bcb0863d83d0045038712f31a80db4.tar
dexon-28b9792f69bcb0863d83d0045038712f31a80db4.tar.gz
dexon-28b9792f69bcb0863d83d0045038712f31a80db4.tar.bz2
dexon-28b9792f69bcb0863d83d0045038712f31a80db4.tar.lz
dexon-28b9792f69bcb0863d83d0045038712f31a80db4.tar.xz
dexon-28b9792f69bcb0863d83d0045038712f31a80db4.tar.zst
dexon-28b9792f69bcb0863d83d0045038712f31a80db4.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.
Diffstat (limited to 'core/vm/sqlvm')
-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
+}