Обсуждение: Crash in json_to_record()

Поиск
Список
Период
Сортировка

Crash in json_to_record()

От
Jeff Davis
Дата:
The attached script crashes on master. It looks like it assumes
get_call_result_type() always returns a non-NULL tupdesc.

Regards,
    Jeff Davis


Вложения

Re: Crash in json_to_record()

От
Jeff Davis
Дата:
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


Вложения