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

Function TestConnQueryDifferentScanPlansIssue781

stdlib/sql_test.go:424–437  ·  view source on GitHub ↗

https://github.com/jackc/pgx/issues/781

(t *testing.T)

Source from the content-addressed store, hash-verified

422
423// https://github.com/jackc/pgx/issues/781
424func TestConnQueryDifferentScanPlansIssue781(t *testing.T) {
425 testWithAllQueryExecModes(t, func(t *testing.T, db *sql.DB) {
426 var s string
427 var b bool
428
429 rows, err := db.Query("select true, 'foo'")
430 require.NoError(t, err)
431
432 require.True(t, rows.Next())
433 require.NoError(t, rows.Scan(&b, &s))
434 assert.Equal(t, true, b)
435 assert.Equal(t, "foo", s)
436 })
437}
438
439func TestConnQueryNull(t *testing.T) {
440 testWithAllQueryExecModes(t, func(t *testing.T, db *sql.DB) {

Callers

nothing calls this directly

Calls 4

QueryMethod · 0.65
NextMethod · 0.65
ScanMethod · 0.65

Tested by

no test coverage detected