float4/float8/int64 passed by value with tsearch fixup - Mailing list pgsql-patches

From Zoltan Boszormenyi
Subject float4/float8/int64 passed by value with tsearch fixup
Date
Msg-id 47F0C634.5010801@cybertec.at
Whole thread Raw
In response to Re: Re: int8/float8/time/timestamp[tz]/float4 passed by value, was Re: Fix HAVE_LONG[_LONG]_INT_64 to really define to 1  (Zoltan Boszormenyi <zb@cybertec.at>)
Responses Re: float4/float8/int64 passed by value with tsearch fixup  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: float4/float8/int64 passed by value with tsearch fixup  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Hi,

I tried to split the previous patch up to see where the tsearch regression
comes from. So, it turned out that:
- float4 conversion is risk free (patch #1)
- float8 conversion is okay, too, if coupled with time[stamp[tz]] conversion
     (patch #2) but with int64 timestamps enabled, the next one is also
needed:
- int64 conversion (patch #3) is mostly okay but it is the one that's
causing
  the tsearch regression

I looked at the tsearch code and found only one thing that can be
suspicious, namely:

typedef uint64 TSQuerySign;

TSQuerySign is handled almost everywhere as an allocated,
passed-by-reference value. I converted it with the attached patch (#4)
so it uses Int64GetDatum() and DatumGetInt64() functions internally
and the regression went away. Please, consider applying all four patches.

Best regards,
Zoltán Böszörményi

--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/


Attachment

pgsql-patches by date:

Previous
From: "Brendan Jurd"
Date:
Subject: Re: Consistent \d commands in psql
Next
From: Tom Lane
Date:
Subject: Re: Consistent \d commands in psql