Skip to content

Commit 30e37cd

Browse files
authored
Fix corner case. (#22152)
1 parent adce17c commit 30e37cd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arangod/Aql/ExecutionNode/GraphNode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ CostEstimate GraphNode::estimateCost() const {
784784
size_t estDepth = _options->estimateDepth();
785785
double tmpNrItems = incoming * std::pow(baseNumItems, estDepth);
786786
// Protect against size_t overflow, just to be sure.
787-
if (tmpNrItems > static_cast<double>(std::numeric_limits<size_t>::max())) {
787+
if (tmpNrItems >= static_cast<double>(std::numeric_limits<size_t>::max())) {
788788
// This will be an expensive query...
789789
estimate.estimatedNrItems = std::numeric_limits<size_t>::max();
790790
} else {

arangod/Graph/ShortestPathOptions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ double ShortestPathOptions::estimateCost(size_t& nrItems) const {
171171
// This theory asumes that the shortest path is at most 7 steps of length
172172

173173
double tmp = std::pow(baseCreateItems, 7);
174-
nrItems = tmp > static_cast<double>(std::numeric_limits<size_t>::max())
174+
nrItems = tmp >= static_cast<double>(std::numeric_limits<size_t>::max())
175175
? std::numeric_limits<size_t>::max()
176176
: static_cast<size_t>(tmp);
177177
return std::pow(baseCost, 7);

0 commit comments

Comments
 (0)