MCPcopy Index your code
hub / github.com/lib/pq / TestErrorOnQueryRowSimpleQuery

Function TestErrorOnQueryRowSimpleQuery

conn_test.go:648–655  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

646}
647
648func TestErrorOnQueryRowSimpleQuery(t *testing.T) {
649 tx := pqtest.Begin(t, pqtest.MustDB(t))
650 pqtest.Exec(t, tx, `create temp table foo(f1 int primary key)`)
651
652 var v int
653 err := tx.QueryRow("insert into foo values (0), (0)").Scan(&v)
654 mustAs(t, err, pqerror.UniqueViolation)
655}
656
657// Test the QueryRow bug workarounds in stmt.exec() and simpleQuery()
658func TestQueryRowBugWorkaround(t *testing.T) {

Callers

nothing calls this directly

Calls 5

BeginFunction · 0.92
MustDBFunction · 0.92
ExecFunction · 0.92
mustAsFunction · 0.85
ScanMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…