Re: [HACKERS] NULL-pointer check and incorrect comment for pstate in addRangeTableEntry

2015-03-11 Thread Michael Paquier
On Thu, Mar 12, 2015 at 4:36 AM, Robert Haas wrote: > On Wed, Mar 4, 2015 at 7:38 AM, Michael Paquier > wrote: >> On Wed, Mar 4, 2015 at 9:12 PM, Greg Stark wrote: >>> This sounded familiar... I pointed out the same thing a while back and Tom >>> had some feedback on what to do about it: >>> >>>

Re: [HACKERS] NULL-pointer check and incorrect comment for pstate in addRangeTableEntry

2015-03-11 Thread Robert Haas
On Wed, Mar 4, 2015 at 7:38 AM, Michael Paquier wrote: > On Wed, Mar 4, 2015 at 9:12 PM, Greg Stark wrote: >> This sounded familiar... I pointed out the same thing a while back and Tom >> had some feedback on what to do about it: >> >> http://www.postgresql.org/message-id/23294.1384142...@sss.pgh

Re: [HACKERS] NULL-pointer check and incorrect comment for pstate in addRangeTableEntry

2015-03-04 Thread Greg Stark
On Wed, Mar 4, 2015 at 12:38 PM, Michael Paquier wrote: > Translated into code I guess that this gives the attached patch. Probably want to update a comment somewhere but yes, those are the same three call sites I had found back then. I don't see any patch lying around so I don't think I got any

Re: [HACKERS] NULL-pointer check and incorrect comment for pstate in addRangeTableEntry

2015-03-04 Thread Michael Paquier
On Wed, Mar 4, 2015 at 9:12 PM, Greg Stark wrote: > This sounded familiar... I pointed out the same thing a while back and Tom > had some feedback on what to do about it: > > http://www.postgresql.org/message-id/23294.1384142...@sss.pgh.pa.us Translated into code I guess that this gives the attac

Re: [HACKERS] NULL-pointer check and incorrect comment for pstate in addRangeTableEntry

2015-03-04 Thread Greg Stark
This sounded familiar... I pointed out the same thing a while back and Tom had some feedback on what to do about it: http://www.postgresql.org/message-id/23294.1384142...@sss.pgh.pa.us On 4 Mar 2015 00:37, "Michael Paquier" wrote: > On Wed, Mar 4, 2015 at 6:43 AM, Robert Haas wrote: > > That see

Re: [HACKERS] NULL-pointer check and incorrect comment for pstate in addRangeTableEntry

2015-03-03 Thread Michael Paquier
On Wed, Mar 4, 2015 at 6:43 AM, Robert Haas wrote: > That seems to make sense to me. Committed. Thanks. -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] NULL-pointer check and incorrect comment for pstate in addRangeTableEntry

2015-03-03 Thread Robert Haas
On Wed, Feb 25, 2015 at 7:27 AM, Michael Paquier wrote: > Coverity is pointing out that addRangeTableEntry contains the > following code path that does a NULL-pointer check on pstate: > if (pstate != NULL) > pstate->p_rtable = lappend(pstate->p_rtable, rte); > But pstate is

[HACKERS] NULL-pointer check and incorrect comment for pstate in addRangeTableEntry

2015-02-25 Thread Michael Paquier
Hi all, Coverity is pointing out that addRangeTableEntry contains the following code path that does a NULL-pointer check on pstate: if (pstate != NULL) pstate->p_rtable = lappend(pstate->p_rtable, rte); But pstate is dereferenced before in isLockedRefname when grabbing the