This commit is contained in:
Yuce Tekol 2019-07-09 16:41:18 +03:00
parent c2cbaddba8
commit d6bb5c65de
No known key found for this signature in database
GPG key ID: CB59E46D2FB90573

View file

@ -253,6 +253,13 @@ func (e *executor) executeCall(ctx context.Context, index string, c *pql.Call, s
return nil, errors.Wrap(err, "validating args")
}
indexTag := fmt.Sprintf("index:%s", index)
// Fixes #2009
// See: https://github.com/pilosa/pilosa/issues/2009
if e.detectRangeCall(c) {
e.Holder.Logger.Printf("DEPRECATED: Range() is deprecated, please use Row() instead.")
}
// Special handling for mutation and top-n calls.
switch c.Name {
case "Sum":
@ -1406,10 +1413,6 @@ func (e *executor) executeRowShard(ctx context.Context, index string, c *pql.Cal
span, _ := tracing.StartSpanFromContext(ctx, "Executor.executeRowShard")
defer span.Finish()
if c.Name == "Range" {
e.Holder.Logger.Printf("DEPRECATED: Range() is deprecated, please use Row() instead.")
}
// Handle bsiGroup ranges differently.
if c.HasConditionArg() {
return e.executeRowBSIGroupShard(ctx, index, c, shard)
@ -2849,6 +2852,19 @@ func (e *executor) translateResult(index string, idx *Index, call *pql.Call, res
return result, nil
}
func (e *executor) detectRangeCall(c *pql.Call) bool {
// detect whether there is a Range call
if c.Name == "Range" {
return true
}
for _, c := range c.Children {
if e.detectRangeCall(c) {
return true
}
}
return false
}
// validateQueryContext returns a query-appropriate error if the context is done.
func validateQueryContext(ctx context.Context) error {
select {