MCPcopy
hub / github.com/jackc/pgx / TestConnExecParamsEmptySQL

Function TestConnExecParamsEmptySQL

pgconn/pgconn_test.go:1378–1394  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1376}
1377
1378func TestConnExecParamsEmptySQL(t *testing.T) {
1379 t.Parallel()
1380
1381 ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
1382 defer cancel()
1383
1384 pgConn, err := pgconn.Connect(ctx, os.Getenv("PGX_TEST_DATABASE"))
1385 require.NoError(t, err)
1386 defer closeConn(t, pgConn)
1387
1388 result := pgConn.ExecParams(ctx, "", nil, nil, nil, nil).Read()
1389 assert.Equal(t, pgconn.CommandTag{}, result.CommandTag)
1390 assert.Len(t, result.Rows, 0)
1391 assert.NoError(t, result.Err)
1392
1393 ensureConnValid(t, pgConn)
1394}
1395
1396// https://github.com/jackc/pgx/issues/859
1397func TestResultReaderValuesHaveSameCapacityAsLength(t *testing.T) {

Callers

nothing calls this directly

Calls 6

ConnectFunction · 0.92
closeConnFunction · 0.70
ensureConnValidFunction · 0.70
LenMethod · 0.65
ReadMethod · 0.45
ExecParamsMethod · 0.45

Tested by

no test coverage detected