File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -287,6 +287,16 @@ AddEnumLabel(Oid enumTypeOid,
287
287
other_nbr_en = (Form_pg_enum ) GETSTRUCT (existing [other_nbr_index ]);
288
288
newelemorder = (nbr_en -> enumsortorder +
289
289
other_nbr_en -> enumsortorder ) / 2 ;
290
+
291
+ /*
292
+ * On some machines, newelemorder may be in a register that's
293
+ * wider than float4. We need to force it to be rounded to
294
+ * float4 precision before making the following comparisons,
295
+ * or we'll get wrong results. (Such behavior violates the C
296
+ * standard, but fixing the compilers is out of our reach.)
297
+ */
298
+ newelemorder = DatumGetFloat4 (Float4GetDatum (newelemorder ));
299
+
290
300
if (newelemorder == nbr_en -> enumsortorder ||
291
301
newelemorder == other_nbr_en -> enumsortorder )
292
302
{
You can’t perform that action at this time.
0 commit comments