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-03-26 17:48:22 +0800
commit382a5c1b3640e5a17fe1484aa8d650858a710abd (patch)
tree287bd4af06bf8dbeedb1e83af6eb28fc6e448ce8
parent2504595f7a879a193aeb7e938cfde6ea42028911 (diff)
downloaddexon-382a5c1b3640e5a17fe1484aa8d650858a710abd.tar.gz
dexon-382a5c1b3640e5a17fe1484aa8d650858a710abd.tar.zst
dexon-382a5c1b3640e5a17fe1484aa8d650858a710abd.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
+}