From 28b9792f69bcb0863d83d0045038712f31a80db4 Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Wed, 13 Mar 2019 17:59:36 +0800 Subject: 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. --- core/vm/sqlvm/schema/schema.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'core/vm/sqlvm') 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 +} -- cgit v1.2.3