diff options
author | Jhih-Ming Huang <jm.huang@cobinhood.com> | 2019-04-22 17:56:20 +0800 |
---|---|---|
committer | Jhih-Ming Huang <jm@dexon.org> | 2019-05-08 21:45:52 +0800 |
commit | bf103451425a0f7a986ff6dd1e2b7d1e478bd948 (patch) | |
tree | 7f7a1a91496be7403dbb73844e8379c2f0f5c541 /core/vm/sqlvm/schema | |
parent | d0f2c8fac94f6917e4e997fd0b236d4de36e41d1 (diff) | |
download | dexon-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.go | 5 |
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, } } |