pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Handle ReadFile() EOF correctly on Windows.
Date: Wed, 20 Nov 2019 05:32:43 +0000
Message-ID: <E1iXIbb-00040g-3r@gemulon.postgresql.org> (raw)

Handle ReadFile() EOF correctly on Windows.

When ReadFile() encounters the end of a file while reading from
a synchronous handle with an offset provided via OVERLAPPED, it
reports an error instead of returning 0.  By not handling that
(undocumented) result correctly, we caused some noisy LOG
messages about an unknown error code.  Repair.

Back-patch to 12, where we started using pread()/ReadFile() with
an offset.

Reported-by: ZhenHua Cai, Amit Kapila
Diagnosed-by: Juan Jose Santamaria Flecha
Tested-by: Amit Kapila
Discussion: https://postgr.es/m/CAA4eK1LK3%2BWRtpz68TiRdpHwxxWm%3D%2Bt1BMf-G68hhQsAQ41PZg%40mail.gmail.com

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2189f49c420f2bf49dfac122f9fbae51c3565594

Modified Files
--------------
src/port/pread.c | 3 +++
1 file changed, 3 insertions(+)



view thread (2+ messages)

Message-ID: <E1iXIbb-00040g-3r@gemulon.postgresql.org>
Permalink:  ../E1iXIbb-00040g-3r@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iXIbb-00040g-3r@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tmunro@postgresql.org
  Subject: Re: pgsql: Handle ReadFile() EOF correctly on Windows.
  In-Reply-To: <E1iXIbb-00040g-3r@gemulon.postgresql.org>
  References: <E1iXIbb-00040g-3r@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox