[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
|
Список | 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 по дате отправления: