(t *testing.T)
| 646 | } |
| 647 | |
| 648 | func 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() |
| 658 | func TestQueryRowBugWorkaround(t *testing.T) { |