From 9d5e78257645a49ec42e86577d9a6de248463dba Mon Sep 17 00:00:00 2001 From: reshke Date: Tue, 23 Apr 2024 06:14:26 +0000 Subject: [PATCH] Add test --- test/xproto/proto_test.go | 43 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/test/xproto/proto_test.go b/test/xproto/proto_test.go index 1d65765bd..f6553b35e 100644 --- a/test/xproto/proto_test.go +++ b/test/xproto/proto_test.go @@ -2304,6 +2304,48 @@ func TestMultiPortal(t *testing.T) { } tt := []MessageGroup{ + { + Request: []pgproto3.FrontendMessage{ + &pgproto3.Parse{ + Name: "mp-0-1", + Query: "SELECT 1", + }, + &pgproto3.Sync{}, + + &pgproto3.Bind{ + DestinationPortal: "", + PreparedStatement: "mp-0-1", + }, + &pgproto3.Sync{}, + + &pgproto3.Execute{ + Portal: "", + }, + &pgproto3.Sync{}, + }, + + Response: []pgproto3.BackendMessage{ + + &pgproto3.ParseComplete{}, + &pgproto3.ReadyForQuery{ + TxStatus: byte(txstatus.TXIDLE), + }, + + &pgproto3.BindComplete{}, + + &pgproto3.ReadyForQuery{ + TxStatus: byte(txstatus.TXIDLE), + }, + + &pgproto3.ErrorResponse{ + Severity: "ERROR", + Code: "34000", + }, + &pgproto3.ReadyForQuery{ + TxStatus: byte(txstatus.TXIDLE), + }, + }, + }, { Request: []pgproto3.FrontendMessage{ &pgproto3.Parse{ @@ -2422,7 +2464,6 @@ func TestMultiPortal(t *testing.T) { retMsgType.SeverityUnlocalized = "" retMsgType.File = "" retMsgType.Message = "" - retMsgType.Code = "" case *pgproto3.RowDescription: for i := range retMsgType.Fields {