From c0ac6a7d506f738a1239d8a6750f69dd67d626ef Mon Sep 17 00:00:00 2001 From: Domen Ipavec Date: Mon, 4 Sep 2017 16:35:37 +0200 Subject: [PATCH] Do not ignore order on distinct query (#1570) --- search.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/search.go b/search.go index 2e273584..90138595 100644 --- a/search.go +++ b/search.go @@ -2,7 +2,6 @@ package gorm import ( "fmt" - "regexp" ) type search struct { @@ -73,13 +72,7 @@ func (s *search) Order(value interface{}, reorder ...bool) *search { return s } -var distinctSQLRegexp = regexp.MustCompile(`(?i)distinct[^a-z]+[a-z]+`) - func (s *search) Select(query interface{}, args ...interface{}) *search { - if distinctSQLRegexp.MatchString(fmt.Sprint(query)) { - s.ignoreOrderQuery = true - } - s.selects = map[string]interface{}{"query": query, "args": args} return s }