(t *testing.T)
| 302 | } |
| 303 | |
| 304 | func TestConnQuery(t *testing.T) { |
| 305 | testWithAllQueryExecModes(t, func(t *testing.T, db *sql.DB) { |
| 306 | skipCockroachDB(t, db, "Server issues incorrect ParameterDescription (https://github.com/cockroachdb/cockroach/issues/60907)") |
| 307 | |
| 308 | rows, err := db.Query("select 'foo', n from generate_series($1::int, $2::int) n", int32(1), int32(10)) |
| 309 | require.NoError(t, err) |
| 310 | |
| 311 | rowCount := int64(0) |
| 312 | |
| 313 | for rows.Next() { |
| 314 | rowCount++ |
| 315 | |
| 316 | var s string |
| 317 | var n int64 |
| 318 | err := rows.Scan(&s, &n) |
| 319 | require.NoError(t, err) |
| 320 | if s != "foo" { |
| 321 | t.Errorf(`Expected "foo", received "%v"`, s) |
| 322 | } |
| 323 | if n != rowCount { |
| 324 | t.Errorf("Expected %d, received %d", rowCount, n) |
| 325 | } |
| 326 | } |
| 327 | require.NoError(t, rows.Err()) |
| 328 | require.EqualValues(t, 10, rowCount) |
| 329 | |
| 330 | err = rows.Close() |
| 331 | require.NoError(t, err) |
| 332 | }) |
| 333 | } |
| 334 | |
| 335 | func TestConnConcurrency(t *testing.T) { |
| 336 | testWithAllQueryExecModes(t, func(t *testing.T, db *sql.DB) { |
nothing calls this directly
no test coverage detected