aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/sqlvm/schema
diff options
context:
space:
mode:
authorJhih-Ming Huang <jm.huang@cobinhood.com>2019-04-22 17:56:20 +0800
committerJhih-Ming Huang <jm@dexon.org>2019-05-08 21:45:52 +0800
commitbf103451425a0f7a986ff6dd1e2b7d1e478bd948 (patch)
tree7f7a1a91496be7403dbb73844e8379c2f0f5c541 /core/vm/sqlvm/schema
parentd0f2c8fac94f6917e4e997fd0b236d4de36e41d1 (diff)
downloaddexon-bf103451425a0f7a986ff6dd1e2b7d1e478bd948.tar
dexon-bf103451425a0f7a986ff6dd1e2b7d1e478bd948.tar.gz
dexon-bf103451425a0f7a986ff6dd1e2b7d1e478bd948.tar.bz2
dexon-bf103451425a0f7a986ff6dd1e2b7d1e478bd948.tar.lz
dexon-bf103451425a0f7a986ff6dd1e2b7d1e478bd948.tar.xz
dexon-bf103451425a0f7a986ff6dd1e2b7d1e478bd948.tar.zst
dexon-bf103451425a0f7a986ff6dd1e2b7d1e478bd948.zip
core: vm: sqlvm: runtime: implement fillAutoInc and fillDefault
This commit implements fillAutoInc and fillDefault, and modifies Storage.IncSequence such that it can handle the numbers larger than maximum of uint64.
Diffstat (limited to 'core/vm/sqlvm/schema')
-rw-r--r--core/vm/sqlvm/schema/schema.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/vm/sqlvm/schema/schema.go b/core/vm/sqlvm/schema/schema.go
index 1e87d88cf..71122cc26 100644
--- a/core/vm/sqlvm/schema/schema.go
+++ b/core/vm/sqlvm/schema/schema.go
@@ -180,7 +180,7 @@ type Column struct {
// NewColumn return a Column instance.
func NewColumn(Name []byte, Type ast.DataType, Attr ColumnAttr,
- ForeignKeys []ColumnDescriptor, Sequence SequenceRef) Column {
+ ForeignKeys []ColumnDescriptor, Sequence SequenceRef, def interface{}) Column {
c := column{
Name: Name,
Type: Type,
@@ -190,7 +190,8 @@ func NewColumn(Name []byte, Type ast.DataType, Attr ColumnAttr,
}
return Column{
- column: c,
+ column: c,
+ Default: def,
}
}