Skip to content

Commit fc9e96e

Browse files
authored
Merge pull request #2725 from dolthub/zachmu/enginetests5
[no-release-notes] Removed IsServerEngine dependency from an enginetest
2 parents 2c6e3dd + a638abc commit fc9e96e

File tree

3 files changed

+18
-20
lines changed

3 files changed

+18
-20
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)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662
77
github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71
88
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81
9-
github.com/dolthub/vitess v0.0.0-20241016191424-d14e107a654e
9+
github.com/dolthub/vitess v0.0.0-20241028204000-267861bc75a0
1010
github.com/go-kit/kit v0.10.0
1111
github.com/go-sql-driver/mysql v1.7.2-0.20231213112541-0004702b931d
1212
github.com/gocraft/dbr/v2 v2.7.2

go.sum

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,8 @@ github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71 h1:bMGS25NWAGTE
5858
github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71/go.mod h1:2/2zjLQ/JOOSbbSboojeg+cAwcRV0fDLzIiWch/lhqI=
5959
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81 h1:7/v8q9XGFa6q5Ap4Z/OhNkAMBaK5YeuEzwJt+NZdhiE=
6060
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81/go.mod h1:siLfyv2c92W1eN/R4QqG/+RjjX5W2+gCTRjZxBjI3TY=
61-
github.com/dolthub/vitess v0.0.0-20241009160728-54c0746cbff7 h1:mepdzTqvr0ZAbyOEsdgLg/nJ2qQzLJIwHD7xityHzz4=
62-
github.com/dolthub/vitess v0.0.0-20241009160728-54c0746cbff7/go.mod h1:uBvlRluuL+SbEWTCZ68o0xvsdYZER3CEG/35INdzfJM=
63-
github.com/dolthub/vitess v0.0.0-20241010201417-9d4f54b29ccc h1:ZZgTRuxEwd3X67njtK30buHeZScLAd4W0rbRV8CORhE=
64-
github.com/dolthub/vitess v0.0.0-20241010201417-9d4f54b29ccc/go.mod h1:uBvlRluuL+SbEWTCZ68o0xvsdYZER3CEG/35INdzfJM=
65-
github.com/dolthub/vitess v0.0.0-20241016191424-d14e107a654e h1:Ssd/iV0hAOShAgr0c4pJQNgh2E4my2XHblFIIam0D+4=
66-
github.com/dolthub/vitess v0.0.0-20241016191424-d14e107a654e/go.mod h1:uBvlRluuL+SbEWTCZ68o0xvsdYZER3CEG/35INdzfJM=
61+
github.com/dolthub/vitess v0.0.0-20241028204000-267861bc75a0 h1:eeKypNsi1nQmjWxSAAWT6tvRsDWdmll03BozAUUIE4E=
62+
github.com/dolthub/vitess v0.0.0-20241028204000-267861bc75a0/go.mod h1:uBvlRluuL+SbEWTCZ68o0xvsdYZER3CEG/35INdzfJM=
6763
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
6864
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
6965
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=

0 commit comments

Comments
 (0)