Skip to content

Commit df523a7

Browse files
committed
Removed IsServerEngine dependency from test
1 parent afe6195 commit df523a7

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

enginetest/enginetests.go

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ func TestOrderByGroupBy(t *testing.T, harness Harness) {
657657
_, rowIter, _, err = e.Query(ctx, "select any_value(id), team from members group by team order by id")
658658
require.NoError(t, err)
659659
rowCount = 0
660-
isServerTest := IsServerEngine(e)
660+
661661
for {
662662
row, err = rowIter.Next(ctx)
663663
if err == io.EOF {
@@ -666,13 +666,14 @@ func TestOrderByGroupBy(t *testing.T, harness Harness) {
666666
rowCount++
667667
require.NoError(t, err)
668668

669-
// TODO: needs fix to match MySQL, which its type is `LONG` = Int32
670-
// currently, we convert any int result to SQL int64 type before sending it over the wire
671669
var val int64
672-
if isServerTest {
673-
val = row[0].(int64)
674-
} else {
675-
val = int64(row[0].(int32))
670+
switch v := row[0].(type) {
671+
case int64:
672+
val = v
673+
case int32:
674+
val = int64(v)
675+
default:
676+
panic(fmt.Sprintf("unexpected type %T", v))
676677
}
677678

678679
team := row[1].(string)
@@ -701,13 +702,14 @@ func TestOrderByGroupBy(t *testing.T, harness Harness) {
701702
rowCount++
702703
require.NoError(t, err)
703704

704-
// TODO: needs fix to match MySQL, which its type is `LONG` = Int32
705-
// currently, we convert any int result to SQL int64 type before sending it over the wire
706705
var val int64
707-
if isServerTest {
708-
val = row[0].(int64)
709-
} else {
710-
val = int64(row[0].(int32))
706+
switch v := row[0].(type) {
707+
case int64:
708+
val = v
709+
case int32:
710+
val = int64(v)
711+
default:
712+
panic(fmt.Sprintf("unexpected type %T", v))
711713
}
712714

713715
team := row[1].(string)

0 commit comments

Comments
 (0)