Commit ff68b256 authored by Tom Lane's avatar Tom Lane

Remove troublesome Asserts in cost_mergejoin().

While logically correct, these two Asserts could fail depending on the
vagaries of floating-point arithmetic.  In particular, on machines with
floating-point registers wider than standard "double" values, it was
possible for the compiler to compare a rounded-to-double value already
stored in memory with an unrounded long double value still in a register.
Given the preceding checks, these assertions aren't adding much, so let's
just get rid of them rather than try to find a compiler-proof fix.
Per report from Pavel Stehule.

Given the lack of previous complaints, and the fact that only developers
would be likely to trip over it, I'm only going to change this in HEAD,
even though the code has been like this for a long time.
parent 89e850e6
...@@ -1933,9 +1933,6 @@ cost_mergejoin(MergePath *path, PlannerInfo *root, SpecialJoinInfo *sjinfo) ...@@ -1933,9 +1933,6 @@ cost_mergejoin(MergePath *path, PlannerInfo *root, SpecialJoinInfo *sjinfo)
outerendsel = outer_rows / outer_path_rows; outerendsel = outer_rows / outer_path_rows;
innerendsel = inner_rows / inner_path_rows; innerendsel = inner_rows / inner_path_rows;
Assert(outerstartsel <= outerendsel);
Assert(innerstartsel <= innerendsel);
/* cost of source data */ /* cost of source data */
if (outersortkeys) /* do we need to sort outer? */ if (outersortkeys) /* do we need to sort outer? */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment