Skip to content

Commit b91f3c7

Browse files
committed
Fix: fix pglogrepl.SendStandbyCopyDone
Change the return value '*CopyDoneResult' to struct to avoid NPE when receive a DataRow message.
1 parent 38e8a4e commit b91f3c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pglogrepl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ type CopyDoneResult struct {
671671

672672
// SendStandbyCopyDone sends a StandbyCopyDone to the PostgreSQL server
673673
// to confirm ending the copy-both mode.
674-
func SendStandbyCopyDone(_ context.Context, conn *pgconn.PgConn) (cdr *CopyDoneResult, err error) {
674+
func SendStandbyCopyDone(_ context.Context, conn *pgconn.PgConn) (cdr CopyDoneResult, err error) {
675675
// I am suspicious that this is wildly wrong, but I'm pretty sure the previous
676676
// code was wildly wrong too -- wttw <steve@blighty.com>
677677
conn.Frontend().Send(&pgproto3.CopyDone{})

0 commit comments

Comments
 (0)