Add test case for #677

pull/678/head
Jack Christensen 2020-02-07 16:07:43 -06:00
parent ea0eacc0b6
commit 8c9d1cc15b
1 changed files with 12 additions and 0 deletions

View File

@ -351,6 +351,18 @@ func TestPoolQueryRow(t *testing.T) {
assert.EqualValues(t, 1, stats.TotalConns())
}
// https://github.com/jackc/pgx/issues/677
func TestPoolQueryRowErrNoRows(t *testing.T) {
t.Parallel()
pool, err := pgxpool.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
require.NoError(t, err)
defer pool.Close()
err = pool.QueryRow(context.Background(), "select n from generate_series(1,10) n where n=0").Scan(nil)
require.Equal(t, pgx.ErrNoRows, err)
}
func TestPoolSendBatch(t *testing.T) {
t.Parallel()