Skip to content

Commit 468b9e5

Browse files
committed
Fix benchmark
1 parent 9faabe5 commit 468b9e5

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

benchmark_test.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,17 @@ func BenchmarkRoundtripBin(b *testing.B) {
216216

217217
func BenchmarkInterpolation(b *testing.B) {
218218
mc := &mysqlConn{
219-
cfg: &config{interpolateParams: true},
219+
cfg: &config{
220+
interpolateParams: true,
221+
loc: time.UTC,
222+
},
220223
maxPacketAllowed: maxPacketSize,
221224
maxWriteSize: maxPacketSize - 1,
222225
}
223226

224227
args := []driver.Value{
225-
42424242,
226-
math.Pi,
228+
int64(42424242),
229+
float64(math.Pi),
227230
false,
228231
time.Unix(1423411542, 807015000),
229232
[]byte("bytes containing special chars ' \" \a \x00"),
@@ -234,6 +237,9 @@ func BenchmarkInterpolation(b *testing.B) {
234237
b.ReportAllocs()
235238
b.ResetTimer()
236239
for i := 0; i < b.N; i++ {
237-
mc.interpolateParams(q, args)
240+
_, err := mc.interpolateParams(q, args)
241+
if err != nil {
242+
b.Fatal(err)
243+
}
238244
}
239245
}

0 commit comments

Comments
 (0)