Skip to content

Commit

Permalink
Merge pull request #266 from pikot/master
Browse files Browse the repository at this point in the history
date and datetime can be unsigned
  • Loading branch information
kshvakov authored Apr 8, 2020
2 parents 4c3871c + e8f88dd commit 4668557
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/column/date.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ func (dt *Date) Write(encoder *binary.Encoder, v interface{}) error {
return encoder.Int16(value)
case int32:
timestamp = int64(value) + dt.offset
case uint32:
timestamp = int64(value) + dt.offset
case uint64:
timestamp = int64(value) + dt.offset
case int64:
timestamp = value + dt.offset
case string:
Expand Down
4 changes: 4 additions & 0 deletions lib/column/datetime.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ func (dt *DateTime) Write(encoder *binary.Encoder, v interface{}) error {
timestamp = int64(value)
case int32:
timestamp = int64(value)
case uint32:
timestamp = int64(value)
case uint64:
timestamp = int64(value)
case int64:
timestamp = value
case string:
Expand Down

0 comments on commit 4668557

Please sign in to comment.