diff --git a/conn_pool_test.go b/conn_pool_test.go index 1d364253..1dde72bd 100644 --- a/conn_pool_test.go +++ b/conn_pool_test.go @@ -433,3 +433,25 @@ func TestConnPoolQuery(t *testing.T) { t.Fatalf("Unexpected connection pool stats: %v", stats) } } + +func TestConnPoolQueryRow(t *testing.T) { + t.Parallel() + + pool := createConnPool(t, 2) + defer pool.Close() + + var n int32 + err := pool.QueryRow("select 40+$1", 2).Scan(&n) + if err != nil { + t.Fatalf("pool.QueryRow Scan failed: %v", err) + } + + if n != 42 { + t.Errorf("Expected 42, got %d", n) + } + + stats := pool.Stat() + if stats.CurrentConnections != 1 || stats.AvailableConnections != 1 { + t.Fatalf("Unexpected connection pool stats: %v", stats) + } +}