| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
To satisfy the latest spec, the data of type of address and fixed bytes will
be stored in bytes instead of decimal value.
|
|
|
|
|
|
| |
Refine behaviors:
1. Check decimal.NewFromString by type instead of string compare.
2. Use Rescale in DecimalEncode.
|
| |
|
|
|
|
|
|
| |
We make the zero value invalid by design. Users must be aware of the
difference between SQL boolean and Go boolean and initialize it
explicitly.
|
|
|
|
|
|
|
|
| |
SQL uses three-valued logic which includes an unknown state. To prevent
the reader of the code from confusing the unknown value with the unknown
data type defined here, we rename 'unknown' data type to 'pending'
because it is intended to be used by nodes whose type has not been
determined.
|
|
|
|
|
|
| |
It is unsafe to write a map concurrently. Even if it is unlikely for us
to call it from multiple threads, it is better to avoid providing an
thread-unsafe API when it is possible.
|
|
|
|
|
|
|
|
| |
Since we have dropped DataTypeEncode in favor of GetType method of
TypeNode, rename DataTypeDecode to GetNode and make it a method.
Drop unnecessary zero checks because we don't care minor bytes when
there is only one type belong to a category.
|
|
|
|
|
|
|
|
| |
To allow callers to provide precise error messages, return an error
message in addition to an error code from GetType of TypeNode.
Drop DataTypeEncode because it is never used by any code and it has
become a simple wrapper of GetType.
|
|
|
|
| |
We will add more methods to DataType.
|
|
|
|
|
| |
deciaml.IntPart() returns int64, so we have to implement a function to
convert deciaml to uint64 for reading primary id from Raw.
|
|
|
|
| |
Move error code to errors.go, and implement Size method for column field.
|
|
|
|
|
| |
It is possible that the number to encode is produced by arithmetic
operations and has negative exponent even when it is an integer.
Properly handle this case and modify test cases to check it.
|
| |
|
|
|
|
|
|
|
| |
In addition to changes required to move DataTypeEncode and
DataTypeDecode to use TypeNode interface, this commit also unifies the
meaning of 'Size' field in 'FixedBytesTypeNode'. It always counts the
length in bytes now.
|
|
|
|
|
|
|
|
|
| |
In order to make our AST easier and safer to use, all declarations with
empty interface type are now removed.
This changes also makes it possible to traverse the AST without using
reflection or understanding what each type means because all AST nodes
have at least one common interface.
|
|
|
|
|
| |
The data range is deterministic for specific type, `GetMinMax` is
helper function to generate min, max value for clients.
|
|
|
|
| |
Implement schema struct and handle its rlp serialization.
|
|
Add encoder/decoder to convert between decimal and bytes. Also handle
issues below.
* Signed & Unsigned
* Padding
* Floating point of fixed
|