From a9b1a057c57b799c6ac29ed474b253dbeb620114 Mon Sep 17 00:00:00 2001 From: Bartek Nowotarski Date: Thu, 26 Jul 2018 13:17:25 +0200 Subject: [PATCH] Timebounds query fix --- services/horizon/CHANGELOG.md | 6 ++++++ services/horizon/internal/ingest/ingestion.go | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/services/horizon/CHANGELOG.md b/services/horizon/CHANGELOG.md index 780ec2fc09..f6d86409c1 100644 --- a/services/horizon/CHANGELOG.md +++ b/services/horizon/CHANGELOG.md @@ -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 diff --git a/services/horizon/internal/ingest/ingestion.go b/services/horizon/internal/ingest/ingestion.go index 48c2723b14..c3fc550e81 100644 --- a/services/horizon/internal/ingest/ingestion.go +++ b/services/horizon/internal/ingest/ingestion.go @@ -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) }