Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
databases/mongodb70: fix build on 14-current
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
- Loading branch information
1 parent
e9a2add
commit 3d3f9b4
Showing
7 changed files
with
171 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
databases/mongodb70/files/patch-src_mongo_db_exec_document__value_value.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- src/mongo/db/exec/document_value/value.cpp.orig 2023-06-15 22:07:57 UTC | ||
+++ src/mongo/db/exec/document_value/value.cpp | ||
@@ -59,6 +59,12 @@ using namespace std::string_literals; | ||
using std::vector; | ||
using namespace std::string_literals; | ||
|
||
+RCVector::RCVector() { | ||
+} | ||
+ | ||
+RCVector::RCVector(std::vector<Value> v) : vec(std::move(v)) { | ||
+} | ||
+ | ||
void ValueStorage::verifyRefCountingIfShould() const { | ||
switch (type) { | ||
case MinKey: |
13 changes: 13 additions & 0 deletions
13
databases/mongodb70/files/patch-src_mongo_db_exec_document__value_value__internal.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- src/mongo/db/exec/document_value/value_internal.h.orig 2023-06-15 22:07:57 UTC | ||
+++ src/mongo/db/exec/document_value/value_internal.h | ||
@@ -51,8 +51,8 @@ class RCVector : public RefCountable { (public) | ||
/// A heap-allocated reference-counted std::vector | ||
class RCVector : public RefCountable { | ||
public: | ||
- RCVector() {} | ||
- RCVector(std::vector<Value> v) : vec(std::move(v)) {} | ||
+ RCVector(); | ||
+ RCVector(std::vector<Value> v); | ||
std::vector<Value> vec; | ||
}; | ||
|
46 changes: 46 additions & 0 deletions
46
databases/mongodb70/files/patch-src_mongo_db_exec_near.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- 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) { |
74 changes: 74 additions & 0 deletions
74
databases/mongodb70/files/patch-src_mongo_s_write__ops_write__op.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- src/mongo/s/write_ops/write_op.h.orig 2023-06-15 22:07:57 UTC | ||
+++ src/mongo/s/write_ops/write_op.h | ||
@@ -38,7 +38,7 @@ struct TargetedWrite; | ||
namespace mongo { | ||
|
||
struct TargetedWrite; | ||
-struct ChildWriteOp; | ||
+class WriteOp; | ||
|
||
enum WriteOpState { | ||
// Item is ready to be targeted | ||
@@ -63,6 +63,31 @@ enum WriteOpState { | ||
}; | ||
|
||
/** | ||
+ * State of a write in-progress (to a single shard) which is one part of a larger write | ||
+ * operation. | ||
+ * | ||
+ * As above, the write op may finish in either a successful (_Completed) or unsuccessful | ||
+ * (_Error) state. | ||
+ */ | ||
+struct ChildWriteOp { | ||
+ ChildWriteOp(WriteOp* const parent) : parentOp(parent) {} | ||
+ | ||
+ const WriteOp* const parentOp; | ||
+ | ||
+ WriteOpState state{WriteOpState_Ready}; | ||
+ | ||
+ // non-zero when state == _Pending | ||
+ // Not owned here but tracked for reporting | ||
+ TargetedWrite* pendingWrite{nullptr}; | ||
+ | ||
+ // filled when state > _Pending | ||
+ std::unique_ptr<ShardEndpoint> endpoint; | ||
+ | ||
+ // filled when state == _Error or (optionally) when state == _Cancelled | ||
+ boost::optional<write_ops::WriteError> error; | ||
+}; | ||
+ | ||
+/** | ||
* State of a single write item in-progress from a client request. | ||
* | ||
* The lifecyle of a write op: | ||
@@ -182,30 +207,6 @@ class WriteOp { (private) | ||
// stores the shards where this write operation succeeded | ||
absl::flat_hash_set<ShardId> _successfulShardSet; | ||
-}; | ||
-/** | ||
- * State of a write in-progress (to a single shard) which is one part of a larger write | ||
- * operation. | ||
- * | ||
- * As above, the write op may finish in either a successful (_Completed) or unsuccessful | ||
- * (_Error) state. | ||
- */ | ||
-struct ChildWriteOp { | ||
- ChildWriteOp(WriteOp* const parent) : parentOp(parent) {} | ||
- | ||
- const WriteOp* const parentOp; | ||
- | ||
- WriteOpState state{WriteOpState_Ready}; | ||
- | ||
- // non-zero when state == _Pending | ||
- // Not owned here but tracked for reporting | ||
- TargetedWrite* pendingWrite{nullptr}; | ||
- | ||
- // filled when state > _Pending | ||
- std::unique_ptr<ShardEndpoint> endpoint; | ||
- | ||
- // filled when state == _Error or (optionally) when state == _Cancelled | ||
- boost::optional<write_ops::WriteError> error; | ||
}; | ||
|
||
// First value is write item index in the batch, second value is child write op index |
10 changes: 10 additions & 0 deletions
10
databases/mongodb70/files/patch-src_mongo_util_net_ssl__types.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- src/mongo/util/net/ssl_types.h.orig 2023-06-15 22:07:57 UTC | ||
+++ src/mongo/util/net/ssl_types.h | ||
@@ -61,6 +61,7 @@ class SSLX509Name { (public) | ||
auto equalityLens() const { | ||
return std::tie(oid, type, value); | ||
} | ||
+ friend bool operator==(const Entry& lhs, const Entry& rhs); | ||
}; | ||
|
||
SSLX509Name() = default; |
11 changes: 11 additions & 0 deletions
11
databases/mongodb70/files/patch-src_third__party_boost_boost_mpl_aux___integral__wrapper.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- src/third_party/boost/boost/mpl/aux_/integral_wrapper.hpp.orig 2023-06-15 22:07:57 UTC | ||
+++ src/third_party/boost/boost/mpl/aux_/integral_wrapper.hpp | ||
@@ -56,7 +56,7 @@ struct AUX_WRAPPER_NAME | ||
// have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC), | ||
// while some other don't like 'value + 1' (Borland), and some don't like | ||
// either | ||
-#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) | ||
+#if 1 //BOOST_WORKAROUND(__EDG_VERSION__, <= 243) | ||
private: | ||
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1))); | ||
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1))); |