flinfo NULL in DirectFunctionCall callee?

Поиск
Список
Период
Сортировка
От Paul A Jungwirth
Тема flinfo NULL in DirectFunctionCall callee?
Дата
Msg-id CA+renyUeS3vBGxur6-eZ5YCy_XKK7sFRG77DJezSMxrpeJ-9ag@mail.gmail.com
обсуждение исходный текст
Ответы Re: flinfo NULL in DirectFunctionCall callee?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hello,

I'm writing a multirange_cmp function which calls range_cmp to compare
individual elements. It looks like this:

cmp = DatumGetInt32(DirectFunctionCall2(
        range_cmp,
        RangeTypePGetDatum(r1),
        RangeTypePGetDatum(r2)));

But I get a segfault when range_cmp tries to reach its
fcinfo->flinfo->fn_extra, because it has a NULL flinfo, as you can see
from these debugging messages:

NOTICE:  multirange_cmp fcinfo = 0x7f875a0a66c0
NOTICE:  multirange_cmp flinfo = 0x7f875a0a6690
NOTICE:  multirange_cmp fn_extra = 0x7f875a099450
NOTICE:  range_cmp fcinfo = 0x7ffee5ff9820
NOTICE:  range_cmp flinfo = 0x0

Is it expected for flinfo to be null when using DirectFunctionCall*?
Is there something else I should use instead? It looks like
FunctionCall2 would let me pass my own flinfo, but I'm not sure how to
set that up first.

Thanks!
Paul



В списке pgsql-general по дате отправления:

Предыдущее
От: Luca Ferrari
Дата:
Сообщение: Re: For SELECT statement (just a reading one, no 'FOR UPDATE'), isCOMMIT or ROLLBACK preferred?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: flinfo NULL in DirectFunctionCall callee?