From a340d5f15f5d75eb0cc1f42fdd9996f666dc3224 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Fri, 17 May 2019 13:27:11 -0500 Subject: [PATCH] CopyFail should be frontend message --- backend.go | 3 +++ copy_fail.go | 2 +- frontend.go | 3 --- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend.go b/backend.go index 1121c550..7f11bc7f 100644 --- a/backend.go +++ b/backend.go @@ -14,6 +14,7 @@ type Backend struct { // Frontend message flyweights bind Bind _close Close + copyFail CopyFail describe Describe execute Execute flush Flush @@ -80,6 +81,8 @@ func (b *Backend) Receive() (FrontendMessage, error) { msg = &b.describe case 'E': msg = &b.execute + case 'f': + msg = &b.copyFail case 'H': msg = &b.flush case 'P': diff --git a/copy_fail.go b/copy_fail.go index eadffa9c..2f228a82 100644 --- a/copy_fail.go +++ b/copy_fail.go @@ -11,7 +11,7 @@ type CopyFail struct { Message string } -func (*CopyFail) Backend() {} +func (*CopyFail) Frontend() {} func (dst *CopyFail) Decode(src []byte) error { idx := bytes.IndexByte(src, 0) diff --git a/frontend.go b/frontend.go index ce94f49f..6fa03bce 100644 --- a/frontend.go +++ b/frontend.go @@ -22,7 +22,6 @@ type Frontend struct { copyInResponse CopyInResponse copyOutResponse CopyOutResponse copyDone CopyDone - copyFail CopyFail dataRow DataRow emptyQueryResponse EmptyQueryResponse errorResponse ErrorResponse @@ -82,8 +81,6 @@ func (b *Frontend) Receive() (BackendMessage, error) { msg = &b.dataRow case 'E': msg = &b.errorResponse - case 'f': - msg = &b.copyFail case 'G': msg = &b.copyInResponse case 'H':