From 7277e32d88fac5ffa2fdb8cde1f8974e4c53842f Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Thu, 31 May 2018 14:18:40 +0100 Subject: [PATCH] Fix distinct() with GROUP BY clauses --- util/fncs/sets.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/util/fncs/sets.go b/util/fncs/sets.go index 11799431..40d0ea4f 100644 --- a/util/fncs/sets.go +++ b/util/fncs/sets.go @@ -48,7 +48,14 @@ func distinct(ctx context.Context, args ...interface{}) ([]interface{}, error) { for _, x := range args { a, _ := ensureSlice(x) for _, v := range a { - c[v] = true + switch v := v.(type) { + case []interface{}: + for _, v := range v { + c[v] = true + } + default: + c[v] = true + } } }