@@ -2329,14 +2329,14 @@ func TestPing(t *testing.T) {
2329
2329
})
2330
2330
}
2331
2331
2332
- func TestNoArgsCommand (t * testing.T ) {
2332
+ func TestSimpleCommandOK (t * testing.T ) {
2333
2333
ctx := context .Background ()
2334
2334
for _ , test := range []struct {
2335
2335
method string
2336
2336
query string
2337
2337
funcToCall func (ctx context.Context , mc * mysqlConn ) error
2338
2338
} {
2339
- {method : "Ping " , query : "Ping" , funcToCall : func (ctx context.Context , mc * mysqlConn ) error {return mc .Ping (ctx )}},
2339
+ {method : "Pinger " , query : "Ping" , funcToCall : func (ctx context.Context , mc * mysqlConn ) error {return mc .Ping (ctx )}},
2340
2340
{method : "Conn" , query : "Reset" , funcToCall : func (ctx context.Context , mc * mysqlConn ) error {return mc .Reset (ctx )}},
2341
2341
} {
2342
2342
test := test
@@ -2346,6 +2346,7 @@ func TestNoArgsCommand(t *testing.T) {
2346
2346
if err != nil {
2347
2347
dbt .fail ("db" , "Conn" , err )
2348
2348
}
2349
+ defer conn .Close ()
2349
2350
2350
2351
// Check that affectedRows and insertIds are cleared after each call.
2351
2352
conn .Raw (func (conn any ) error {
@@ -2373,7 +2374,7 @@ func TestNoArgsCommand(t *testing.T) {
2373
2374
t .Errorf ("bad affectedRows: got %v, want=%v" , got , want )
2374
2375
}
2375
2376
if got , want := c .result .insertIds , []int64 (nil ); ! reflect .DeepEqual (got , want ) {
2376
- t .Errorf ("bad affectedRows : got %v, want=%v" , got , want )
2377
+ t .Errorf ("bad insertIds : got %v, want=%v" , got , want )
2377
2378
}
2378
2379
}
2379
2380
return nil
@@ -2390,8 +2391,9 @@ func TestReset(t *testing.T) {
2390
2391
if err != nil {
2391
2392
dbt .fail ("db" , "Conn" , err )
2392
2393
}
2394
+ defer conn .Close ()
2393
2395
2394
- // Check that affectedRows and insertIds are cleared after each call .
2396
+ // Verify that COM_RESET_CONNECTION clears session state (e.g., user variables) .
2395
2397
conn .Raw (func (conn any ) error {
2396
2398
c := conn .(* mysqlConn )
2397
2399
0 commit comments