Re: bool_plperl transform
| От | ilmari@ilmari.org (Dagfinn Ilmari Mannsåker) |
|---|---|
| Тема | Re: bool_plperl transform |
| Дата | |
| Msg-id | 87h7z7wwv2.fsf@wibble.ilmari.org обсуждение исходный текст |
| Ответ на | Re[2]: bool_plperl transform (Wao <wao@mail.ru>) |
| Ответы |
Re[2]: bool_plperl transform
|
| Список | pgsql-hackers |
Wao <wao@mail.ru> writes:
> +Datum
> +bool_to_plperl(PG_FUNCTION_ARGS)
> +{
> + dTHX;
> + bool in = PG_GETARG_BOOL(0);
> + SV *sv = newSVnv(SvNV(in ? &PL_sv_yes : &PL_sv_no));
> + return PointerGetDatum(sv);
> +}
Why is this only copying the floating point part of the built-in
booleans before returning them? I think this should just return
&PL_sv_yes or &PL_sv_no directly, like boolean expressions in Perl do,
and like what happens for NULL (&PL_sv_undef).
- ilmari
--
"A disappointingly low fraction of the human race is,
at any given time, on fire." - Stig Sandbeck Mathisen
В списке pgsql-hackers по дате отправления: