File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 11devel
22-----
33
4+ * Fix a potential integer overflow in shortest path estimation.
5+
46* Fix BTS-2268: Fixed an issue where query plan for queries with subquery
57 is causing a crash when being stored in query plan cache. The issue
68 is a missing invalidateCost from the splice-subqueries rule.
Original file line number Diff line number Diff line change @@ -170,7 +170,10 @@ double ShortestPathOptions::estimateCost(size_t& nrItems) const {
170170 // We use the "seven-degrees-of-seperation" rule.
171171 // This theory asumes that the shortest path is at most 7 steps of length
172172
173- nrItems = static_cast <size_t >(std::pow (baseCreateItems, 7 ));
173+ double tmp = std::pow (baseCreateItems, 7 );
174+ nrItems = tmp > static_cast <double >(std::numeric_limits<size_t >::max ())
175+ ? std::numeric_limits<size_t >::max ()
176+ : static_cast <size_t >(tmp);
174177 return std::pow (baseCost, 7 );
175178}
176179
You can’t perform that action at this time.
0 commit comments