Skip to content

Commit 527b0ab

Browse files
committed
rename method mysqlConn.sendNoArgsCommandWithResultOK() to mysqlConn.sendSimpleCommandOK(), rename related tests accordingly
1 parent 8630716 commit 527b0ab

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

connection.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,10 +503,10 @@ func (mc *mysqlConn) finish() {
503503

504504
// Ping implements driver.Pinger interface
505505
func (mc *mysqlConn) Ping(ctx context.Context) (err error) {
506-
return mc.sendNoArgsCommandWithResultOK(ctx, comPing)
506+
return mc.sendSimpleCommandOK(ctx, comPing)
507507
}
508508

509-
func (mc *mysqlConn) sendNoArgsCommandWithResultOK(ctx context.Context, cmd byte) (err error) {
509+
func (mc *mysqlConn) sendSimpleCommandOK(ctx context.Context, cmd byte) (err error) {
510510
if mc.closed.Load() {
511511
return driver.ErrBadConn
512512
}
@@ -687,7 +687,7 @@ func (mc *mysqlConn) startWatcher() {
687687

688688
// Reset resets the MySQL connection.
689689
func (mc *mysqlConn) Reset(ctx context.Context) (err error) {
690-
return mc.sendNoArgsCommandWithResultOK(ctx, comResetConnection)
690+
return mc.sendSimpleCommandOK(ctx, comResetConnection)
691691
}
692692

693693
func (mc *mysqlConn) CheckNamedValue(nv *driver.NamedValue) (err error) {

connection_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ func TestCheckNamedValue(t *testing.T) {
129129
}
130130
}
131131

132-
// TestNoArgsCommandCleanCancel tests passed context is cancelled at start.
132+
// TestSimpleCommandOKCleanCancel tests passed context is cancelled at start.
133133
// No packet should be sent. Connection should keep current status.
134-
func TestNoArgsCommandCleanCancel(t *testing.T) {
134+
func TestSimpleCommandOKCleanCancel(t *testing.T) {
135135
for _, test := range []struct {
136136
name string
137137
funcToCall func(ctx context.Context, mc *mysqlConn) error
@@ -168,7 +168,7 @@ func TestNoArgsCommandCleanCancel(t *testing.T) {
168168
}
169169
}
170170

171-
func TestNoArgsCommandMarkBadConnection(t *testing.T) {
171+
func TestSimpleCommandOKMarkBadConnection(t *testing.T) {
172172
for _, test := range []struct {
173173
name string
174174
funcToCall func(mc *mysqlConn) error
@@ -196,7 +196,7 @@ func TestNoArgsCommandMarkBadConnection(t *testing.T) {
196196
}
197197
}
198198

199-
func TestNoArgsCommandErrInvalidConn(t *testing.T) {
199+
func TestSimpleCommandOKErrInvalidConn(t *testing.T) {
200200
for _, test := range []struct {
201201
name string
202202
funcToCall func(mc *mysqlConn) error

0 commit comments

Comments
 (0)