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

From Alvaro Herrera
Subject Re: float4/float8/int64 passed by value with tsearch fixup
Date
Msg-id 20080418191008.GC572@alvh.no-ip.org
Whole thread Raw
In response to Re: float4/float8/int64 passed by value with tsearch fixup  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: float4/float8/int64 passed by value with tsearch fixup
List pgsql-patches
Alvaro Herrera wrote:

> With contrib/seg also adjusted to use float4 instead of float32, and
> thus the last usage of float32 gone, I am now wondering if it would be a
> good idea to remove the float32 and float32data definitions in c.h.

Ok, the buildfarm is going yellow over this change.  On "cardinal" I see
this:

*** ./expected/seg.out    Fri Apr 18 20:45:38 2008
--- ./results/seg.out    Fri Apr 18 20:59:40 2008
***************
*** 1069,1218 ****
  SELECT seg_lower(s), seg_center(s), seg_upper(s)
  FROM test_seg WHERE s @> '11.2..11.3' OR s IS NULL ORDER BY s;
   seg_lower | seg_center | seg_upper
! -----------+------------+-----------
!  -Infinity |  -Infinity |        40
!  -Infinity |  -Infinity |        82
!  -Infinity |  -Infinity |        90
!          1 |          7 |        13
!        1.3 |       6.65 |        12
!          2 |       6.75 |      11.5
!        2.1 |       6.95 |      11.8
!        2.3 |   Infinity |  Infinity
!        2.3 |   Infinity |  Infinity
!        2.4 |       6.85 |      11.3
!        2.5 |          7 |      11.5
!        2.5 |       7.15 |      11.8
!        2.6 |   Infinity |  Infinity
!        2.7 |       7.35 |        12
!          3 |   Infinity |  Infinity
!          3 |       30.5 |        58
!        3.1 |        7.3 |      11.5
!        3.5 |        7.5 |      11.5
!        3.5 |       7.85 |      12.2
!          4 |          8 |        12
!          4 |   Infinity |  Infinity
!          4 |          8 |        12
!          4 |       7.85 |      11.7
!          4 |       8.25 |      12.5
!          4 |        8.5 |        13
!          4 |         32 |        60
!          4 |   Infinity |  Infinity
!        4.2 |       7.85 |      11.5
!        4.2 |       7.95 |      11.7
!        4.5 |       8.25 |        12
!        4.5 |          8 |      11.5
!        4.5 |       8.25 |        12
!        4.5 |       8.25 |        12
!        4.5 |        8.5 |      12.5
!        4.5 |      59.75 |       115
!        4.7 |       8.25 |      11.8
!        4.8 |       8.15 |      11.5
!        4.8 |        8.2 |      11.6
!        4.8 |       8.65 |      12.5
!        4.8 |   Infinity |  Infinity
!        4.9 |       8.45 |        12
!        4.9 |   Infinity |  Infinity
!          5 |       8.25 |      11.5
!          5 |        8.5 |        12
!          5 |       17.5 |        30
!          5 |        8.2 |      11.4
!          5 |       8.25 |      11.5
!          5 |        8.3 |      11.6
!          5 |       8.35 |      11.7
!          5 |        8.5 |        12
!          5 |        8.5 |        12
!          5 |        8.5 |        12
!        5.2 |       8.35 |      11.5
!        5.2 |        8.6 |        12
!       5.25 |      8.625 |        12
!        5.3 |        8.4 |      11.5
!        5.3 |       9.15 |        13
!        5.3 |      47.65 |        90
!        5.3 |   Infinity |  Infinity
!        5.4 |   Infinity |  Infinity
!        5.5 |        8.5 |      11.5
!        5.5 |        8.6 |      11.7
!        5.5 |       8.75 |        12
!        5.5 |       8.75 |        12
!        5.5 |          9 |      12.5
!        5.5 |        9.5 |      13.5
!        5.5 |   Infinity |  Infinity
!        5.5 |   Infinity |  Infinity
!        5.7 |   Infinity |  Infinity
!        5.9 |   Infinity |  Infinity
!          6 |       8.75 |      11.5
!          6 |          9 |        12
!          6 |       8.75 |      11.5
!          6 |        9.5 |        13
!          6 |       8.75 |      11.5
!        6.1 |       9.05 |        12
!        6.1 |   Infinity |  Infinity
!        6.2 |       8.85 |      11.5
!        6.3 |   Infinity |  Infinity
!        6.5 |          9 |      11.5
!        6.5 |       9.25 |        12
!        6.5 |       9.25 |        12
!        6.5 |   Infinity |  Infinity
!        6.6 |   Infinity |  Infinity
!        6.7 |        9.1 |      11.5
!        6.7 |   Infinity |  Infinity
!       6.75 |   Infinity |  Infinity
!        6.8 |   Infinity |  Infinity
!        6.9 |       9.55 |      12.2
!        6.9 |      48.45 |        90
!        6.9 |   Infinity |  Infinity
!          7 |       9.25 |      11.5
!          7 |       9.25 |      11.5
!          7 |       9.25 |      11.5
!          7 |   Infinity |  Infinity
!       7.15 |   Infinity |  Infinity
!        7.2 |      10.35 |      13.5
!        7.3 |      48.65 |        90
!        7.3 |   Infinity |  Infinity
!        7.3 |   Infinity |  Infinity
!        7.4 |       9.75 |      12.1
!        7.4 |   Infinity |  Infinity
!        7.5 |        9.5 |      11.5
!        7.5 |       9.75 |        12
!        7.5 |   Infinity |  Infinity
!        7.7 |        9.6 |      11.5
!        7.7 |   Infinity |  Infinity
!       7.75 |   Infinity |  Infinity
!          8 |       9.85 |      11.7
!          8 |         10 |        12
!          8 |       10.5 |        13
!        8.2 |   Infinity |  Infinity
!        8.3 |   Infinity |  Infinity
!        8.5 |         10 |      11.5
!        8.5 |       10.5 |      12.5
!        8.5 |   Infinity |  Infinity
!        8.6 |       53.8 |        99
!        8.7 |         10 |      11.3
!        8.7 |       10.2 |      11.7
!        8.9 |       10.2 |      11.5
!          9 |       10.5 |        12
!          9 |      10.15 |      11.3
!          9 |      10.25 |      11.5
!          9 |       10.5 |        12
!          9 |   Infinity |  Infinity
!        9.2 |       10.6 |        12
!        9.4 |       10.8 |      12.2
!        9.5 |      10.75 |        12
!        9.5 |      10.85 |      12.2
!        9.5 |   Infinity |  Infinity
!        9.6 |      10.55 |      11.5
!        9.7 |       10.6 |      11.5
!        9.7 |      10.85 |        12
!        9.8 |      11.15 |      12.5
!         10 |       10.8 |      11.6
!         10 |      10.75 |      11.5
!         10 |      11.25 |      12.5
!         10 |      11.25 |      12.5
!       10.2 |         11 |      11.8
!       10.5 |         11 |      11.5
!       10.5 |         11 |      11.5
!       10.5 |         12 |      13.5
!       10.7 |       11.5 |      12.3
             |            |
  (144 rows)

--- 1069,1218 ----
  SELECT seg_lower(s), seg_center(s), seg_upper(s)
  FROM test_seg WHERE s @> '11.2..11.3' OR s IS NULL ORDER BY s;
    seg_lower   |  seg_center  |  seg_upper
! --------------+--------------+--------------
!  -3.40315e-06 | -3.40315e-06 | -3.40315e-06
!  -3.40286e-06 | -3.40286e-06 | -3.40286e-06
!  -3.40296e-06 | -3.40296e-06 | -3.40296e-06
!  -3.40056e-06 | -3.40056e-06 | -3.40056e-06
!  -3.39789e-06 | -3.39789e-06 | -3.39789e-06
!  -3.39752e-06 | -3.39752e-06 | -3.39752e-06
!  -3.39735e-06 | -3.39735e-06 | -3.39735e-06
!  -3.40043e-06 | -3.40043e-06 | -3.40043e-06
!  -3.39825e-06 | -3.39825e-06 | -3.39825e-06
!  -3.39722e-06 | -3.39722e-06 | -3.39722e-06
!  -3.39715e-06 | -3.39715e-06 | -3.39715e-06
!  -3.39714e-06 | -3.39714e-06 | -3.39714e-06
!    -3.397e-06 |   -3.397e-06 |   -3.397e-06
!  -3.39695e-06 | -3.39695e-06 | -3.39695e-06
!  -3.40275e-06 | -3.40275e-06 | -3.40275e-06
!  -3.39669e-06 | -3.39669e-06 | -3.39669e-06
!  -3.39641e-06 | -3.39641e-06 | -3.39641e-06
!  -3.39605e-06 | -3.39605e-06 | -3.39605e-06
!  -3.39604e-06 | -3.39604e-06 | -3.39604e-06
!   -3.4025e-06 |  -3.4025e-06 |  -3.4025e-06
!  -3.40257e-06 | -3.40257e-06 | -3.40257e-06
!  -3.39517e-06 | -3.39517e-06 | -3.39517e-06
!  -3.39504e-06 | -3.39504e-06 | -3.39504e-06
!  -3.39503e-06 | -3.39503e-06 | -3.39503e-06
!  -3.39503e-06 | -3.39503e-06 | -3.39503e-06
!  -3.39489e-06 | -3.39489e-06 | -3.39489e-06
!  -3.39509e-06 | -3.39509e-06 | -3.39509e-06
!  -3.39464e-06 | -3.39464e-06 | -3.39464e-06
!  -3.39463e-06 | -3.39463e-06 | -3.39463e-06
!  -3.40236e-06 | -3.40236e-06 | -3.40236e-06
!  -3.39408e-06 | -3.39408e-06 | -3.39408e-06
!  -3.39361e-06 | -3.39361e-06 | -3.39361e-06
!   -3.3936e-06 |  -3.3936e-06 |  -3.3936e-06
!  -3.39387e-06 | -3.39387e-06 | -3.39387e-06
!  -3.39408e-06 | -3.39408e-06 | -3.39408e-06
!  -3.39333e-06 | -3.39333e-06 | -3.39333e-06
!  -3.39309e-06 | -3.39309e-06 | -3.39309e-06
!  -3.39308e-06 | -3.39308e-06 | -3.39308e-06
!  -3.39307e-06 | -3.39307e-06 | -3.39307e-06
!  -3.39311e-06 | -3.39311e-06 | -3.39311e-06
!  -3.39279e-06 | -3.39279e-06 | -3.39279e-06
!  -3.39287e-06 | -3.39287e-06 | -3.39287e-06
!  -3.39274e-06 | -3.39274e-06 | -3.39274e-06
!  -3.39273e-06 | -3.39273e-06 | -3.39273e-06
!  -3.39272e-06 | -3.39272e-06 | -3.39272e-06
!  -3.39258e-06 | -3.39258e-06 | -3.39258e-06
!  -3.39257e-06 | -3.39257e-06 | -3.39257e-06
!  -3.39257e-06 | -3.39257e-06 | -3.39257e-06
!  -3.39256e-06 | -3.39256e-06 | -3.39256e-06
!  -3.39255e-06 | -3.39255e-06 | -3.39255e-06
!  -3.39227e-06 | -3.39227e-06 | -3.39227e-06
!  -3.39228e-06 | -3.39228e-06 | -3.39228e-06
!  -3.39186e-06 | -3.39186e-06 | -3.39186e-06
!  -3.39161e-06 | -3.39161e-06 | -3.39161e-06
!  -3.39155e-06 | -3.39155e-06 | -3.39155e-06
!  -3.39148e-06 | -3.39148e-06 | -3.39148e-06
!  -3.39147e-06 | -3.39147e-06 | -3.39147e-06
!  -3.39128e-06 | -3.39128e-06 | -3.39128e-06
!  -3.39153e-06 | -3.39153e-06 | -3.39153e-06
!  -3.39126e-06 | -3.39126e-06 | -3.39126e-06
!  -3.39106e-06 | -3.39106e-06 | -3.39106e-06
!  -3.39105e-06 | -3.39105e-06 | -3.39105e-06
!  -3.39105e-06 | -3.39105e-06 | -3.39105e-06
!  -3.39074e-06 | -3.39074e-06 | -3.39074e-06
!  -3.39104e-06 | -3.39104e-06 | -3.39104e-06
!  -3.39103e-06 | -3.39103e-06 | -3.39103e-06
!   -3.3911e-06 |  -3.3911e-06 |  -3.3911e-06
!  -3.39841e-06 | -3.39841e-06 | -3.39841e-06
!   -3.3904e-06 |  -3.3904e-06 |  -3.3904e-06
!   -3.3896e-06 |  -3.3896e-06 |  -3.3896e-06
!  -3.38943e-06 | -3.38943e-06 | -3.38943e-06
!  -3.38936e-06 | -3.38936e-06 | -3.38936e-06
!  -3.38925e-06 | -3.38925e-06 | -3.38925e-06
!  -3.38924e-06 | -3.38924e-06 | -3.38924e-06
!  -3.39837e-06 | -3.39837e-06 | -3.39837e-06
!  -3.38867e-06 | -3.38867e-06 | -3.38867e-06
!  -3.38885e-06 | -3.38885e-06 | -3.38885e-06
!  -3.38815e-06 | -3.38815e-06 | -3.38815e-06
!  -3.38805e-06 | -3.38805e-06 | -3.38805e-06
!  -3.38735e-06 | -3.38735e-06 | -3.38735e-06
!  -3.38735e-06 | -3.38735e-06 | -3.38735e-06
!  -3.38705e-06 | -3.38705e-06 | -3.38705e-06
!  -3.38742e-06 | -3.38742e-06 | -3.38742e-06
!  -3.38694e-06 | -3.38694e-06 | -3.38694e-06
!  -3.38672e-06 | -3.38672e-06 | -3.38672e-06
!  -3.38673e-06 | -3.38673e-06 | -3.38673e-06
!  -3.38624e-06 | -3.38624e-06 | -3.38624e-06
!  -3.38618e-06 | -3.38618e-06 | -3.38618e-06
!  -3.38581e-06 | -3.38581e-06 | -3.38581e-06
!  -3.38561e-06 | -3.38561e-06 | -3.38561e-06
!  -3.38583e-06 | -3.38583e-06 | -3.38583e-06
!   -3.3988e-06 |  -3.3988e-06 |  -3.3988e-06
!  -3.38541e-06 | -3.38541e-06 | -3.38541e-06
!  -3.38512e-06 | -3.38512e-06 | -3.38512e-06
!  -3.38548e-06 | -3.38548e-06 | -3.38548e-06
!  -3.39831e-06 | -3.39831e-06 | -3.39831e-06
!   -3.3848e-06 |  -3.3848e-06 |  -3.3848e-06
!  -3.38396e-06 | -3.38396e-06 | -3.38396e-06
!  -3.38423e-06 | -3.38423e-06 | -3.38423e-06
!   -3.3981e-06 |  -3.3981e-06 |  -3.3981e-06
!   -3.3839e-06 |  -3.3839e-06 |  -3.3839e-06
!  -3.38392e-06 | -3.38392e-06 | -3.38392e-06
!   -3.3836e-06 |  -3.3836e-06 |  -3.3836e-06
!   -3.3836e-06 |  -3.3836e-06 |  -3.3836e-06
!  -3.38369e-06 | -3.38369e-06 | -3.38369e-06
!  -3.38304e-06 | -3.38304e-06 | -3.38304e-06
!  -3.38309e-06 | -3.38309e-06 | -3.38309e-06
!   -3.3827e-06 |  -3.3827e-06 |  -3.3827e-06
!  -3.38223e-06 | -3.38223e-06 | -3.38223e-06
!  -3.38222e-06 | -3.38222e-06 | -3.38222e-06
!  -3.38207e-06 | -3.38207e-06 | -3.38207e-06
!   -3.3819e-06 |  -3.3819e-06 |  -3.3819e-06
!  -3.38171e-06 | -3.38171e-06 | -3.38171e-06
!  -3.38131e-06 | -3.38131e-06 | -3.38131e-06
!  -3.38141e-06 | -3.38141e-06 | -3.38141e-06
!  -3.38147e-06 | -3.38147e-06 | -3.38147e-06
!  -3.38122e-06 | -3.38122e-06 | -3.38122e-06
!  -3.38118e-06 | -3.38118e-06 | -3.38118e-06
!  -3.38117e-06 | -3.38117e-06 | -3.38117e-06
!  -3.38084e-06 | -3.38084e-06 | -3.38084e-06
!  -3.38079e-06 | -3.38079e-06 | -3.38079e-06
!   -3.3807e-06 |  -3.3807e-06 |  -3.3807e-06
!  -3.38069e-06 | -3.38069e-06 | -3.38069e-06
!  -3.38068e-06 | -3.38068e-06 | -3.38068e-06
!  -3.38077e-06 | -3.38077e-06 | -3.38077e-06
!  -3.38057e-06 | -3.38057e-06 | -3.38057e-06
!   -3.3805e-06 |  -3.3805e-06 |  -3.3805e-06
!  -3.39849e-06 | -3.39849e-06 | -3.39849e-06
!  -3.39848e-06 | -3.39848e-06 | -3.39848e-06
!  -3.38048e-06 | -3.38048e-06 | -3.38048e-06
!  -3.38036e-06 | -3.38036e-06 | -3.38036e-06
!  -3.38032e-06 | -3.38032e-06 | -3.38032e-06
!   -3.3803e-06 |  -3.3803e-06 |  -3.3803e-06
!  -3.38026e-06 | -3.38026e-06 | -3.38026e-06
!  -3.40282e-06 | -3.40282e-06 | -3.40282e-06
!  -3.38017e-06 | -3.38017e-06 | -3.38017e-06
!  -3.38017e-06 | -3.38017e-06 | -3.38017e-06
!  -3.38016e-06 | -3.38016e-06 | -3.38016e-06
!  -3.38014e-06 | -3.38014e-06 | -3.38014e-06
!  -3.40054e-06 | -3.40054e-06 | -3.40054e-06
!  -3.38008e-06 | -3.38008e-06 | -3.38008e-06
!  -3.38007e-06 | -3.38007e-06 | -3.38007e-06
!  -3.38004e-06 | -3.38004e-06 | -3.38004e-06
                |              |
  (144 rows)


So clearly the data is not being passed around as expected.

Please note that this is a completely new test -- prior to this commit,
these functions were not being called at all.  So it is quite possible
that they have been failed for long.

I assume this is just some dumb portability mistake on my part ... or
perhaps the fact that the functions are still using v0 fmgr convention?

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: float4/float8/int64 passed by value with tsearch fixup
Next
From: Tom Lane
Date:
Subject: Re: float4/float8/int64 passed by value with tsearch fixup