Updated Ping to return ErrBadConn

Added TestOpenContext
Added TestFileCopyTruncate
Added ping to doTestOpen
This commit is contained in:
MichaelS11
2019-06-18 13:33:26 -07:00
parent c25061c4b7
commit 57484d0899
3 changed files with 238 additions and 11 deletions

View File

@@ -10,7 +10,6 @@ package sqlite3
import (
"database/sql/driver"
"errors"
"context"
)
@@ -18,7 +17,8 @@ import (
// Ping implement Pinger.
func (c *SQLiteConn) Ping(ctx context.Context) error {
if c.db == nil {
return errors.New("Connection was closed")
// must be ErrBadConn for sql to close the database
return driver.ErrBadConn
}
return nil
}