Merge pull request #756 from niaow/postgres-sql-empty

Write empty column headers in postgres when there is no response
This commit is contained in:
Nia 2020-08-28 14:20:22 -04:00 • committed by GitHub
commit a872548b01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -394,6 +394,14 @@ func (s *Server) handleStandard(ctx context.Context, proto Protocol, conn net.Co
return errors.Wrap(err, "failed to send query error to client")
}
} else {
if !qwriter.wroteHeaders {
// The handler did not write headers.
// Write back an empty set of headers.
err = qwriter.WriteHeader()
if err != nil {
return errors.Wrap(err, "sending empty column headers")
}
}
// The query completed normally.
// Notify the client of completion.
msg, err = encoder.CommandComplete(qwriter.tag)