mirror of https://github.com/jackc/pgx.git
Fix: Prepare statement without result set
parent
a74871c8ab
commit
0e30c0ae61
|
@ -454,6 +454,7 @@ func (c *Connection) Prepare(name, sql string) (err error) {
|
||||||
ps.FieldDescriptions[i].FormatCode = 1
|
ps.FieldDescriptions[i].FormatCode = 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case noData:
|
||||||
case readyForQuery:
|
case readyForQuery:
|
||||||
c.rxReadyForQuery(r)
|
c.rxReadyForQuery(r)
|
||||||
c.preparedStatements[name] = &ps
|
c.preparedStatements[name] = &ps
|
||||||
|
|
|
@ -495,6 +495,11 @@ func TestPrepare(t *testing.T) {
|
||||||
t.Errorf("Expected: %#v Received: %#v", bytea, result)
|
t.Errorf("Expected: %#v Received: %#v", bytea, result)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mustExecute(t, conn, "create temporary table foo(id serial)")
|
||||||
|
if err = conn.Prepare("deleteFoo", "delete from foo"); err != nil {
|
||||||
|
t.Fatalf("Unable to prepare delete: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPrepareFailure(t *testing.T) {
|
func TestPrepareFailure(t *testing.T) {
|
||||||
|
|
|
@ -21,6 +21,7 @@ const (
|
||||||
parameterDescription = 't'
|
parameterDescription = 't'
|
||||||
bindComplete = '2'
|
bindComplete = '2'
|
||||||
notificationResponse = 'A'
|
notificationResponse = 'A'
|
||||||
|
noData = 'n'
|
||||||
)
|
)
|
||||||
|
|
||||||
type startupMessage struct {
|
type startupMessage struct {
|
||||||
|
|
Loading…
Reference in New Issue