pgsql: Ensure libpq reports a suitable error message on unexpected sock

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Ensure libpq reports a suitable error message on unexpected sock
Date: 2014-10-22 22:42:32
Message-ID: E1Xh4bw-0000YP-No@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Ensure libpq reports a suitable error message on unexpected socket EOF.

The EOF-detection logic in pqReadData was a bit confused about who should
set up the error message in case the kernel gives us read-ready-but-no-data
rather than ECONNRESET or some other explicit error condition. Since the
whole point of this situation is that the lower-level functions don't know
there's anything wrong, pqReadData itself must set up the message. But
keep the assumption that if an errno was reported, a message was set up at
lower levels.

Per bug #11712 from Marko Tiikkaja. It's been like this for a very long
time, so back-patch to all supported branches.

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/98144378c4811b71728e5d78c043d6a147e5e0bc

Modified Files
--------------
src/interfaces/libpq/fe-misc.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2014-10-23 01:44:13 pgsql: Minimize calls of pg_class_aclcheck to minimum necessary
Previous Message Tom Lane 2014-10-22 20:19:10 Re: pgsql: Allow empty target list in SELECT.