Fix distinct() with GROUP BY clauses

This commit is contained in:
Tobie Morgan Hitchcock 2018-05-31 14:18:40 +01:00
parent ddefed03e6
commit 7277e32d88

View file

@ -48,8 +48,15 @@ func distinct(ctx context.Context, args ...interface{}) ([]interface{}, error) {
for _, x := range args { for _, x := range args {
a, _ := ensureSlice(x) a, _ := ensureSlice(x)
for _, v := range a { for _, v := range a {
switch v := v.(type) {
case []interface{}:
for _, v := range v {
c[v] = true c[v] = true
} }
default:
c[v] = true
}
}
} }
for k := range c { for k := range c {