Skip to content

Commit 8abbf75

Browse files
committed
use type.compare to compare values
1 parent 0bfede6 commit 8abbf75

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sql/expression/function/aggregation/window_framer.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ package aggregation
1616

1717
import (
1818
"errors"
19-
"io"
20-
"reflect"
21-
2219
ast "github.com/dolthub/vitess/go/vt/sqlparser"
2320
sqlerr "gopkg.in/src-d/go-errors.v1"
21+
"io"
2422

2523
"github.com/dolthub/go-mysql-server/sql"
2624
"github.com/dolthub/go-mysql-server/sql/expression"
@@ -599,7 +597,11 @@ func isNewOrderByValue(ctx *sql.Context, orderByExprs []sql.Expression, last sql
599597
}
600598

601599
for i := range lastExp {
602-
if !reflect.DeepEqual(lastExp[i], thisExp[i]) {
600+
compare, err := orderByExprs[i].Type().Compare(ctx, lastExp[i], thisExp[i])
601+
if err != nil {
602+
return false, err
603+
}
604+
if compare != 0 {
603605
return true, nil
604606
}
605607
}

0 commit comments

Comments
 (0)