2
0

Update pgconn and pull in fix for QueryRow with empty SQL

This commit is contained in:
Jack Christensen
2020-03-07 13:27:01 -06:00
parent 9e495df1d5
commit 95907c29ce
3 changed files with 25 additions and 2 deletions
+17
View File
@@ -1070,6 +1070,23 @@ func TestQueryRowNoResults(t *testing.T) {
ensureConnValid(t, conn)
}
func TestQueryRowEmptyQuery(t *testing.T) {
t.Parallel()
conn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE"))
defer closeConn(t, conn)
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel()
var n int32
err := conn.QueryRow(ctx, "").Scan(&n)
require.Error(t, err)
require.False(t, pgconn.Timeout(err))
ensureConnValid(t, conn)
}
func TestReadingValueAfterEmptyArray(t *testing.T) {
conn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE"))
defer closeConn(t, conn)