Fix: Prepare statement without result set
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user