mirror of
https://git.freebsd.org/ports.git
synced 2025-05-16 01:01:49 -04:00
Fixes provided by Dimitry in a private reply on https://lists.freebsd.org/archives/freebsd-ports/2023-May/003870.html. Dank je wel! poidriere stage-qa ok runtime tested: proper clean start and restart on existing db
46 lines
1.4 KiB
C++
46 lines
1.4 KiB
C++
--- src/mongo/db/exec/near.cpp.orig 2023-06-15 22:07:57 UTC
|
|
+++ src/mongo/db/exec/near.cpp
|
|
@@ -42,6 +42,21 @@ using std::vector;
|
|
using std::unique_ptr;
|
|
using std::vector;
|
|
|
|
+/**
|
|
+ * Holds a generic search result with a distance computed in some fashion.
|
|
+ */
|
|
+struct NearStage::SearchResult {
|
|
+ SearchResult(WorkingSetID resultID, double distance) : resultID(resultID), distance(distance) {}
|
|
+
|
|
+ bool operator<(const SearchResult& other) const {
|
|
+ // We want increasing distance, not decreasing, so we reverse the <
|
|
+ return distance > other.distance;
|
|
+ }
|
|
+
|
|
+ WorkingSetID resultID;
|
|
+ double distance;
|
|
+};
|
|
+
|
|
NearStage::NearStage(ExpressionContext* expCtx,
|
|
const char* typeName,
|
|
StageType type,
|
|
@@ -113,21 +128,6 @@ PlanStage::StageState NearStage::doWork(WorkingSetID*
|
|
|
|
return nextState;
|
|
}
|
|
-
|
|
-/**
|
|
- * Holds a generic search result with a distance computed in some fashion.
|
|
- */
|
|
-struct NearStage::SearchResult {
|
|
- SearchResult(WorkingSetID resultID, double distance) : resultID(resultID), distance(distance) {}
|
|
-
|
|
- bool operator<(const SearchResult& other) const {
|
|
- // We want increasing distance, not decreasing, so we reverse the <
|
|
- return distance > other.distance;
|
|
- }
|
|
-
|
|
- WorkingSetID resultID;
|
|
- double distance;
|
|
-};
|
|
|
|
// Set "toReturn" when NEED_YIELD.
|
|
PlanStage::StageState NearStage::bufferNext(WorkingSetID* toReturn) {
|