Re: Crash in json_to_record()

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Crash in json_to_record()
Date: 2014-02-24 03:40:04
Message-ID: 1393213204.17606.6.camel@jdavis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, 2014-02-07 at 10:24 -0800, Jeff Davis wrote:
> The attached script crashes on master. It looks like it assumes
> get_call_result_type() always returns a non-NULL tupdesc.

Proposed patch attached; will commit soon unless someone objects.

Checking that get_call_result_type() returns TYPEFUNC_COMPOSITE seems to
be the convention for ensuring the tupdesc is set. I changed the 3 call
sites that do not currently follow that convention (all in jsonfuncs.c).

The other two call sites don't seem to be real problems, but following
the convention seems best.

For the one call site that actually is a problem, I added a HINT to
suggest calling the function from the FROM clause.

Regards,
Jeff Davis

Attachment Content-Type Size
json.patch text/x-patch 2.4 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Sandeep Thakkar 2014-02-24 05:51:58 Re: BUG #9307: I can not install the binary version 9.3.3 under Windows 7 Ultimate
Previous Message Tom Lane 2014-02-23 20:28:18 Re: Re: [HACKERS] Re: BUG #9210: PostgreSQL string store bug? not enforce check with correct characterSET/encoding