do not execute buildSelectQuery twice

if buildSelectQuery() is executed twice, then we get more values in SqlVars than expected
This commit is contained in:
Ivan Pusic 2015-09-28 00:03:51 +02:00
parent 37bf87aa29
commit 246383326c
1 changed files with 1 additions and 1 deletions

View File

@ -217,7 +217,7 @@ func (scope *Scope) selectSql() string {
} }
sql := scope.buildSelectQuery(scope.Search.selects) sql := scope.buildSelectQuery(scope.Search.selects)
scope.Search.countingQuery = (len(scope.Search.group) == 0) && hasCountRegexp.MatchString(sql) scope.Search.countingQuery = (len(scope.Search.group) == 0) && hasCountRegexp.MatchString(sql)
return scope.buildSelectQuery(scope.Search.selects) return sql
} }
func (scope *Scope) orderSql() string { func (scope *Scope) orderSql() string {