Skip to content

Commit baf9f1c

Browse files
committed
fix criticisms in PR 143
1 parent 06d5483 commit baf9f1c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

driver_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func (dbt *DBTest) mustQuery(query string, args ...interface{}) (rows *sql.Rows)
108108
return rows
109109
}
110110

111-
func TestClosedConnection(t *testing.T) {
111+
func TestReuseClosedConnection(t *testing.T) {
112112
// this test does not use sql.database, it uses the driver directly
113113
if !available {
114114
t.Skipf("MySQL-Server not running on %s", netAddr)
@@ -118,7 +118,7 @@ func TestClosedConnection(t *testing.T) {
118118
if err != nil {
119119
t.Fatalf("Error connecting: %s", err.Error())
120120
}
121-
stmt, err := conn.Prepare("SET @tmpif := 1")
121+
stmt, err := conn.Prepare("DO 1")
122122
if err != nil {
123123
t.Fatalf("Error preparing statement: %s", err.Error())
124124
}
@@ -136,7 +136,7 @@ func TestClosedConnection(t *testing.T) {
136136
}
137137
}()
138138
_, err = stmt.Exec(nil)
139-
if err != errInvalidConn {
139+
if err != nil && err != errInvalidConn {
140140
t.Errorf("Unexpected error '%s', expected '%s'",
141141
err.Error(), errInvalidConn.Error())
142142
}

0 commit comments

Comments
 (0)