Do not order subquery if no limit or order is applied
This commit is contained in:
parent
de609de5b3
commit
30f2304e9d
3
main.go
3
main.go
@ -188,6 +188,9 @@ func (s *DB) QueryExpr(alias ...string) *expr {
|
||||
|
||||
// SubQuery returns the query as sub query
|
||||
func (s *DB) SubQuery() *expr {
|
||||
if s.search.limit == nil && s.search.offset == nil {
|
||||
s = s.Order(nil, true)
|
||||
}
|
||||
scope := s.NewScope(s.Value)
|
||||
scope.InstanceSet("skip_bindvar", true)
|
||||
scope.prepareQuerySQL()
|
||||
|
Loading…
x
Reference in New Issue
Block a user