diff --git a/connection.go b/connection.go index 0a1d04b7..e2a3ff79 100644 --- a/connection.go +++ b/connection.go @@ -454,6 +454,7 @@ func (c *Connection) Prepare(name, sql string) (err error) { ps.FieldDescriptions[i].FormatCode = 1 } } + case noData: case readyForQuery: c.rxReadyForQuery(r) c.preparedStatements[name] = &ps diff --git a/connection_test.go b/connection_test.go index 3baf5aec..38d55285 100644 --- a/connection_test.go +++ b/connection_test.go @@ -495,6 +495,11 @@ func TestPrepare(t *testing.T) { 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) { diff --git a/messages.go b/messages.go index a8231ddf..27d7444d 100644 --- a/messages.go +++ b/messages.go @@ -21,6 +21,7 @@ const ( parameterDescription = 't' bindComplete = '2' notificationResponse = 'A' + noData = 'n' ) type startupMessage struct {