mirror of https://gitee.com/bigwinds/arangodb
fix various small annoyances (#9078)
This commit is contained in:
parent
e721dd805d
commit
e440a1c7d2
|
@ -250,7 +250,7 @@ bool AgencyWriteTransaction::validate(AgencyCommResult const& result) const {
|
|||
}
|
||||
|
||||
std::string AgencyWriteTransaction::randomClientId() {
|
||||
std::string uuid = to_string(boost::uuids::random_generator()()), id;
|
||||
std::string uuid = to_string(boost::uuids::random_generator()());
|
||||
|
||||
auto ss = ServerState::instance();
|
||||
if (ss != nullptr && !ss->getId().empty()) {
|
||||
|
|
|
@ -963,7 +963,6 @@ trans_ret_t Agent::transact(query_t const& queries) {
|
|||
// own conclusions. The map of ongoing trxs is only to cover the time
|
||||
// from when we receive the request until we have appended the trxs
|
||||
// ourselves.
|
||||
ret = std::make_shared<arangodb::velocypack::Builder>();
|
||||
failed = 0;
|
||||
ret->openArray();
|
||||
// Only leader else redirect
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClusterCollectionCreationInfo.h"
|
||||
#include "Basics/StaticStrings.h"
|
||||
#include "Basics/VelocyPackHelper.h"
|
||||
|
||||
#include <velocypack/Builder.h>
|
||||
#include <velocypack/Collection.h>
|
||||
|
|
|
@ -21,13 +21,11 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef ARANGOD_CLUSTER_CLUSTER_COLLECTION_CREATION_INFO_H
|
||||
#define ARANGOD_CLUSTER_CLUSTER_COLLECTION_CREATION__INFO_H 1
|
||||
#define ARANGOD_CLUSTER_CLUSTER_COLLECTION_CREATION_INFO_H 1
|
||||
|
||||
#include "Basics/Common.h"
|
||||
|
||||
#include "Basics/StaticStrings.h"
|
||||
#include "Basics/VelocyPackHelper.h"
|
||||
|
||||
#include <velocypack/Builder.h>
|
||||
#include <velocypack/Slice.h>
|
||||
|
||||
namespace arangodb {
|
||||
|
@ -48,11 +46,11 @@ struct ClusterCollectionCreationInfo {
|
|||
public:
|
||||
velocypack::Slice const isBuildingSlice() const;
|
||||
|
||||
private:
|
||||
|
||||
velocypack::Builder _isBuildingJson;
|
||||
private:
|
||||
bool needsBuildingFlag() const;
|
||||
|
||||
private:
|
||||
velocypack::Builder _isBuildingJson;
|
||||
};
|
||||
} // namespace arangodb
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ class DatabaseManagerThread final : public Thread {
|
|||
|
||||
private:
|
||||
// how long will the thread pause between iterations
|
||||
static constexpr unsigned long waitTime() { return 500 * 1000; }
|
||||
static constexpr unsigned long waitTime() { return 500U * 1000U; }
|
||||
};
|
||||
|
||||
class DatabaseFeature : public application_features::ApplicationFeature {
|
||||
|
|
|
@ -3400,7 +3400,7 @@ Result Methods::replicateOperations(LogicalCollection const& collection,
|
|||
count++;
|
||||
}
|
||||
|
||||
if (count <= 0) {
|
||||
if (count == 0) {
|
||||
return Result{};
|
||||
}
|
||||
|
||||
|
|
|
@ -263,7 +263,6 @@ Result Collections::create(TRI_vocbase_t* vocbase,
|
|||
TRI_ASSERT(infoSlice.isArray());
|
||||
TRI_ASSERT(infoSlice.length() >= 1);
|
||||
TRI_ASSERT(infoSlice.length() == infos.size());
|
||||
collections.reserve(infoSlice.length() >= 1);
|
||||
try {
|
||||
if (ServerState::instance()->isCoordinator()) {
|
||||
collections =
|
||||
|
@ -275,6 +274,7 @@ Result Collections::create(TRI_vocbase_t* vocbase,
|
|||
return Result(TRI_ERROR_INTERNAL, "createCollectionsOnCoordinator");
|
||||
}
|
||||
} else {
|
||||
collections.reserve(infoSlice.length());
|
||||
for (auto slice : VPackArrayIterator(infoSlice)) {
|
||||
// Single server does not yet have a multi collection implementation
|
||||
auto col = vocbase->createCollection(slice);
|
||||
|
|
|
@ -2291,7 +2291,7 @@ static void JS_CopyFile(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
if (destinationIsDirectory) {
|
||||
char const* file = strrchr(source.c_str(), TRI_DIR_SEPARATOR_CHAR);
|
||||
if (file == nullptr) {
|
||||
if (destination[destination.length()] == TRI_DIR_SEPARATOR_CHAR) {
|
||||
if (!destination.empty() && destination.back() != TRI_DIR_SEPARATOR_CHAR) {
|
||||
destination += TRI_DIR_SEPARATOR_CHAR;
|
||||
}
|
||||
destination += source;
|
||||
|
|
Loading…
Reference in New Issue