Re: PQexec() hangs on OOM - Mailing list pgsql-bugs

From Amit Kapila
Subject Re: PQexec() hangs on OOM
Date
Msg-id CAA4eK1LG-DHPOHQOF=b2hq5Ee4KEDjT5VuDVkh1h=y6YwKJf8A@mail.gmail.com
Whole thread Raw
In response to Re: PQexec() hangs on OOM  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: PQexec() hangs on OOM  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-bugs
On Sun, Oct 11, 2015 at 6:31 PM, Michael Paquier <michael.paquier@gmail.com>
wrote:
>
>
> Yeah, this behavior is caused by this piece of code:
> @@ -600,7 +601,9 @@ getRowDescriptions(PGconn *conn, int msgLength)
>  advance_and_error:
>         /* Discard unsaved result, if any */
>         if (result && result != conn->result)
>                 PQclear(result);
> An idea may be to check for conn->result->resultStatus !=
> PGRES_FATAL_ERROR to concatenate correctly the error messages using
> pqCatenateResultError. But just returning the first error encountered
> as you mention would be more natural. So I updated the patch this way.
>

Minor comment:
+getParamDescriptions(PGconn *conn, int msgLength)
{
..
+
+ /*
+ * Advance inStart to show that the copy related message has been
+ * processed.
+ */
+ conn->inStart = conn->inCursor;
+
..
}

Reference to 'copy' in above comment seems to be wrong.


Other than that both the patches looks good to me, I will mark this as
Ready for committer.  Please see if you can update the patch soonish,
if you find above comment valid.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #13680: PostgreSQL backend process crashes on jsonb_object_agg() in plpgsql recursive function
Next
From: boyko yordanov
Date:
Subject: Re: BUG #13680: PostgreSQL backend process crashes on jsonb_object_agg() in plpgsql recursive function