[HACKERS] T_Float morph to T_Integer after nodeRead

Поиск
Список
Период
Сортировка
От Kouhei Kaigai
Тема [HACKERS] T_Float morph to T_Integer after nodeRead
Дата
Msg-id 9A28C8860F777E439AA12E8AEA7694F801281D08@BPXM15GP.gisp.nec.co.jp
обсуждение исходный текст
Ответы Re: [HACKERS] T_Float morph to T_Integer after nodeRead  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I noticed a strange behavior when T_Float value is serialized, then deserialized
on the worker process for cpu parallel execution.

Simplified description of what I did is: fval = makeFloat(psprintf("%.0f", plan_nrows)); custom_scan->custom_private =
list_make1(fval);

This string expression contains no dot, then Float value was written out
as if it is an integer value, like "654321".

nodeRead() calls nodeTokenType() to determine the token type.
It determines a numeric token with no dot an Integer value, even if it is
generated by makeFloat(). Then, the worker process reference this value
using floatVal() and gets SEGV.

A workaround is that we never use "%.0f" format for makeFloat().
It may be sufficient because we have small number of makeFloat() call all
around the source tree. Or, do we have any other systematic solution to
prevent numeric cstring without dot?

Thanks,
----
PG-Strom Project / NEC OSS Promotion Center
KaiGai Kohei <kaigai@ak.jp.nec.com>





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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [HACKERS] Reporting planning time with EXPLAIN
Следующее
От: Jonathon Nelson
Дата:
Сообщение: Re: [HACKERS] [PATCH] guc-ify the formerly hard-coded MAX_SEND_SIZEto max_wal_send