Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
38036: opt: fix overflow causing zero row-count r=justinj a=justinj We were subtracting two ints that could overflow and then casting the result to a float64. There's an easy solution to avoid the overflow: just cast each integer to a float64 *before* performing the subtraction. I will backport this to 19.1 and 2.1. Release note (bug fix): Previously, due to a bug when estimating result set sizes in the optimizer, queries involving int ranges that were very large could result in poor plans being generated. Co-authored-by: Justin Jaffray <justin@cockroachlabs.com>
- Loading branch information