Skip to content

Commit

Permalink
Timebounds query fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekn committed Jul 26, 2018
1 parent c5fe0ff commit a9b1a05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions services/horizon/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ file. This project adheres to [Semantic Versioning](http://semver.org/).
As this project is pre 1.0, breaking changes may happen for minor version
bumps. A breaking change will get clearly notified in this log.

## v0.13.1 - 2018-07-26

### Bug fixes

* Fixed a conversion bug when `timebounds.max_time` is set to `INT64_MAX`.

## v0.13.0 - 2018-06-06

### Breaking changes
Expand Down
4 changes: 2 additions & 2 deletions services/horizon/internal/ingest/ingestion.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,8 @@ func (ingest *Ingestion) formatTimeBounds(bounds *xdr.TimeBounds) interface{} {
}

if bounds.MaxTime == 0 {
return sq.Expr("?::int8range", fmt.Sprintf("[%d,]", bounds.MinTime))
return sq.Expr("int8range(?,?)", bounds.MinTime, nil)
}

return sq.Expr("?::int8range", fmt.Sprintf("[%d,%d]", bounds.MinTime, bounds.MaxTime))
return sq.Expr("int8range(?,?)", bounds.MinTime, bounds.MaxTime)
}

0 comments on commit a9b1a05

Please sign in to comment.