From b60c663fdddf6facbb80edb1c645092e3a60f56a Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Fri, 28 Apr 2017 17:09:35 +0100 Subject: [PATCH] SQL models need a different min and max value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the same minimum and maximum value is used in a SQL model … |person:1..1| then the sql query parser will fail. --- sql/scanner.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sql/scanner.go b/sql/scanner.go index 9f103854..b516670c 100644 --- a/sql/scanner.go +++ b/sql/scanner.go @@ -542,6 +542,15 @@ func (s *scanner) scanModel(chp ...rune) (tok Token, lit string, val interface{} return ILLEGAL, buf.String(), val } + // If the minimum value is the + // same as the maximum value then + // error, as there is no ability + // to increment or decrement. + + if min == max { + return ILLEGAL, buf.String(), val + } + // If we have a comma, but the // value is below zero, we will // error as this will cause an