mirror of
https://github.com/postgres/postgres.git
synced 2025-05-31 03:21:24 +03:00
Work around rounding misbehavior exposed by buildfarm.
This commit is contained in:
parent
2d01ec0708
commit
4ba61a487e
@ -287,6 +287,16 @@ restart:
|
|||||||
other_nbr_en = (Form_pg_enum) GETSTRUCT(existing[other_nbr_index]);
|
other_nbr_en = (Form_pg_enum) GETSTRUCT(existing[other_nbr_index]);
|
||||||
newelemorder = (nbr_en->enumsortorder +
|
newelemorder = (nbr_en->enumsortorder +
|
||||||
other_nbr_en->enumsortorder) / 2;
|
other_nbr_en->enumsortorder) / 2;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* On some machines, newelemorder may be in a register that's
|
||||||
|
* wider than float4. We need to force it to be rounded to
|
||||||
|
* float4 precision before making the following comparisons,
|
||||||
|
* or we'll get wrong results. (Such behavior violates the C
|
||||||
|
* standard, but fixing the compilers is out of our reach.)
|
||||||
|
*/
|
||||||
|
newelemorder = DatumGetFloat4(Float4GetDatum(newelemorder));
|
||||||
|
|
||||||
if (newelemorder == nbr_en->enumsortorder ||
|
if (newelemorder == nbr_en->enumsortorder ||
|
||||||
newelemorder == other_nbr_en->enumsortorder)
|
newelemorder == other_nbr_en->enumsortorder)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user