Skip to content

Commit

Permalink
Fix pagination (1)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamralch committed Sep 21, 2022
1 parent a262f26 commit bf5fed6
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions dialect/sql/builder_ext.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ func (x *OrderColumn) UnmarshalText(data []byte) error {
// prepare the name
if len(elem) > 0 {
name = string(elem[0])
name = strings.Replace(name, "`", "", -1)
// name = strings.Replace(name, "`", "", -1)
}

switch len(elem) {
Expand Down Expand Up @@ -608,18 +608,7 @@ func (x *OrderColumn) Err() error {

// Equal returns true the expressions are equal; otherwise false.
func (x *OrderColumn) Equal(y *OrderColumn) bool {
unquote := func(key string) string {
// prepare the name
key = strings.Replace(key, `"`, "", -1)
key = strings.Replace(key, "`", "", -1)
// done
return key
}

cx := unquote(x.column)
cy := unquote(y.column)
//done!
return strings.EqualFold(cx, cy) && strings.EqualFold(x.order, y.order)
return strings.EqualFold(x.column, y.column) && strings.EqualFold(x.order, y.order)
}

// Query returns the order by clause
Expand Down

0 comments on commit bf5fed6

Please sign in to comment.